Package org.apache.lucene.tests.mockfile
Class WindowsFS
java.lang.Object
java.nio.file.spi.FileSystemProvider
org.apache.lucene.tests.mockfile.FilterFileSystemProvider
org.apache.lucene.tests.mockfile.HandleTrackingFS
org.apache.lucene.tests.mockfile.WindowsFS
FileSystem that (imperfectly) acts like windows.
Currently this filesystem only prevents deletion of open files.
-
Field Summary
Fields inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
delegate, fileSystem, scheme -
Constructor Summary
ConstructorsConstructorDescriptionWindowsFS(FileSystem delegate) Create a new instance, wrapping the delegate filesystem to act like Windows. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleandeleteIfExists(Path path) voidmove(Path source, Path target, CopyOption... options) protected voidCalled whenpathis closed viastream.protected voidCalled whenpathis opened viastream.wraps a Path with provider-specific behaviorMethods inherited from class org.apache.lucene.tests.mockfile.HandleTrackingFS
newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newInputStream, newOutputStreamMethods inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
checkAccess, copy, createDirectory, createLink, createSymbolicLink, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, newFileSystem, newFileSystem, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toStringMethods inherited from class java.nio.file.spi.FileSystemProvider
exists, installedProviders, readAttributesIfExists
-
Constructor Details
-
WindowsFS
Create a new instance, wrapping the delegate filesystem to act like Windows.- Parameters:
delegate- delegate filesystem to wrap.
-
-
Method Details
-
onOpen
Description copied from class:HandleTrackingFSCalled whenpathis opened viastream.- Specified by:
onOpenin classHandleTrackingFS- Parameters:
path- Path that was openedstream- Stream or Channel opened against the path.- Throws:
IOException- if an I/O error occurs.
-
onClose
Description copied from class:HandleTrackingFSCalled whenpathis closed viastream.- Specified by:
onClosein classHandleTrackingFS- Parameters:
path- Path that was closedstream- Stream or Channel closed against the path.- Throws:
IOException- if an I/O error occurs.
-
delete
- Overrides:
deletein classFilterFileSystemProvider- Throws:
IOException
-
move
- Overrides:
movein classFilterFileSystemProvider- Throws:
IOException
-
deleteIfExists
- Overrides:
deleteIfExistsin classFilterFileSystemProvider- Throws:
IOException
-
wrapPath
Description copied from class:FilterFileSystemProviderwraps a Path with provider-specific behavior- Overrides:
wrapPathin classFilterFileSystemProvider
-