Package org.apache.lucene.tests.mockfile
Class HandleTrackingFS
- java.lang.Object
- 
- java.nio.file.spi.FileSystemProvider
- 
- org.apache.lucene.tests.mockfile.FilterFileSystemProvider
- 
- org.apache.lucene.tests.mockfile.HandleTrackingFS
 
 
 
- 
- Direct Known Subclasses:
- HandleLimitFS,- LeakFS,- WindowsFS
 
 public abstract class HandleTrackingFS extends FilterFileSystemProvider Base class for tracking file handles.This class adds tracking to all streams/channels and provides two hooks to handle file management: 
- 
- 
Field Summary- 
Fields inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProviderdelegate, fileSystem, scheme
 
- 
 - 
Constructor SummaryConstructors Constructor Description HandleTrackingFS(String scheme, FileSystem delegate)Create a new instance, identified byschemeand passing through operations todelegate.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AsynchronousFileChannelnewAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs)SeekableByteChannelnewByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)DirectoryStream<Path>newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter)FileChannelnewFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs)InputStreamnewInputStream(Path path, OpenOption... options)OutputStreamnewOutputStream(Path path, OpenOption... options)protected abstract voidonClose(Path path, Object stream)Called whenpathis closed viastream.protected abstract voidonOpen(Path path, Object stream)Called whenpathis opened viastream.- 
Methods inherited from class org.apache.lucene.tests.mockfile.FilterFileSystemProvidercheckAccess, copy, createDirectory, createLink, createSymbolicLink, delete, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newFileSystem, newFileSystem, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString, wrapPath
 - 
Methods inherited from class java.nio.file.spi.FileSystemProviderinstalledProviders
 
- 
 
- 
- 
- 
Constructor Detail- 
HandleTrackingFSpublic HandleTrackingFS(String scheme, FileSystem delegate) Create a new instance, identified byschemeand passing through operations todelegate.- Parameters:
- scheme- URI scheme for this provider
- delegate- delegate filesystem to wrap.
 
 
- 
 - 
Method Detail- 
onOpenprotected abstract void onOpen(Path path, Object stream) throws IOException Called whenpathis opened viastream.- Parameters:
- path- Path that was opened
- stream- Stream or Channel opened against the path.
- Throws:
- IOException- if an I/O error occurs.
 
 - 
onCloseprotected abstract void onClose(Path path, Object stream) throws IOException Called whenpathis closed viastream.- Parameters:
- path- Path that was closed
- stream- Stream or Channel closed against the path.
- Throws:
- IOException- if an I/O error occurs.
 
 - 
newInputStreampublic InputStream newInputStream(Path path, OpenOption... options) throws IOException - Overrides:
- newInputStreamin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
newOutputStreampublic OutputStream newOutputStream(Path path, OpenOption... options) throws IOException - Overrides:
- newOutputStreamin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
newFileChannelpublic FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
- newFileChannelin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
newAsynchronousFileChannelpublic AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) throws IOException - Overrides:
- newAsynchronousFileChannelin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
newByteChannelpublic SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
- newByteChannelin class- FilterFileSystemProvider
- Throws:
- IOException
 
 - 
newDirectoryStreampublic DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Overrides:
- newDirectoryStreamin class- FilterFileSystemProvider
- Throws:
- IOException
 
 
- 
 
-