Package org.apache.lucene.tests.mockfile
Class LeakFS
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.LeakFS
FileSystem that tracks open handles.
When FileSystem.close()
is called, this class will throw an exception if any file
handles are still open.
-
Field Summary
Fields inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
delegate, fileSystem, scheme
-
Constructor Summary
ConstructorDescriptionLeakFS
(FileSystem delegate) Create a new instance, tracking file handle leaks for the specified delegate filesystem. -
Method Summary
Methods inherited from class org.apache.lucene.tests.mockfile.HandleTrackingFS
newAsynchronousFileChannel, newByteChannel, newDirectoryStream, newFileChannel, newInputStream, newOutputStream
Methods inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvider
checkAccess, copy, createDirectory, createLink, createSymbolicLink, delete, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newFileSystem, newFileSystem, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString, wrapPath
Methods inherited from class java.nio.file.spi.FileSystemProvider
installedProviders
-
Constructor Details
-
LeakFS
Create a new instance, tracking file handle leaks for the specified delegate filesystem.- Parameters:
delegate
- delegate filesystem to wrap.
-
-
Method Details
-
onOpen
Description copied from class:HandleTrackingFS
Called whenpath
is opened viastream
.- Specified by:
onOpen
in classHandleTrackingFS
- Parameters:
path
- Path that was openedstream
- Stream or Channel opened against the path.
-
onClose
Description copied from class:HandleTrackingFS
Called whenpath
is closed viastream
.- Specified by:
onClose
in classHandleTrackingFS
- Parameters:
path
- Path that was closedstream
- Stream or Channel closed against the path.
-
onClose
public void onClose()Description copied from class:FilterFileSystemProvider
Override to trigger some behavior when the filesystem is closed.This is always called for each FilterFileSystemProvider in the chain.
- Overrides:
onClose
in classFilterFileSystemProvider
-