public abstract class HandleTrackingFS extends FilterFileSystemProvider
This class adds tracking to all streams/channels and provides two hooks to handle file management:
delegate, fileSystem, scheme
Constructor and Description |
---|
HandleTrackingFS(java.lang.String scheme,
java.nio.file.FileSystem delegate)
Create a new instance, identified by
scheme and passing
through operations to delegate . |
Modifier and Type | Method and Description |
---|---|
java.nio.channels.AsynchronousFileChannel |
newAsynchronousFileChannel(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.util.concurrent.ExecutorService executor,
java.nio.file.attribute.FileAttribute<?>... attrs) |
java.nio.channels.SeekableByteChannel |
newByteChannel(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs) |
java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.Path dir,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) |
java.nio.channels.FileChannel |
newFileChannel(java.nio.file.Path path,
java.util.Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs) |
java.io.InputStream |
newInputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options) |
java.io.OutputStream |
newOutputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options) |
protected abstract void |
onClose(java.nio.file.Path path,
java.lang.Object stream)
Called when
path is closed via stream . |
protected abstract void |
onOpen(java.nio.file.Path path,
java.lang.Object stream)
Called when
path is opened via stream . |
checkAccess, copy, createDirectory, createLink, createSymbolicLink, delete, deleteIfExists, getFileAttributeView, getFileStore, getFileSystem, getPath, getScheme, isHidden, isSameFile, move, newFileSystem, newFileSystem, onClose, readAttributes, readAttributes, readSymbolicLink, setAttribute, toDelegate, toString
public HandleTrackingFS(java.lang.String scheme, java.nio.file.FileSystem delegate)
scheme
and passing
through operations to delegate
.scheme
- URI scheme for this providerdelegate
- delegate filesystem to wrap.protected abstract void onOpen(java.nio.file.Path path, java.lang.Object stream) throws java.io.IOException
path
is opened via stream
.path
- Path that was openedstream
- Stream or Channel opened against the path.java.io.IOException
- if an I/O error occurs.protected abstract void onClose(java.nio.file.Path path, java.lang.Object stream) throws java.io.IOException
path
is closed via stream
.path
- Path that was closedstream
- Stream or Channel closed against the path.java.io.IOException
- if an I/O error occurs.public java.io.InputStream newInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws java.io.IOException
newInputStream
in class FilterFileSystemProvider
java.io.IOException
public java.io.OutputStream newOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws java.io.IOException
newOutputStream
in class FilterFileSystemProvider
java.io.IOException
public java.nio.channels.FileChannel newFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException
newFileChannel
in class FilterFileSystemProvider
java.io.IOException
public java.nio.channels.AsynchronousFileChannel newAsynchronousFileChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.util.concurrent.ExecutorService executor, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException
newAsynchronousFileChannel
in class FilterFileSystemProvider
java.io.IOException
public java.nio.channels.SeekableByteChannel newByteChannel(java.nio.file.Path path, java.util.Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws java.io.IOException
newByteChannel
in class FilterFileSystemProvider
java.io.IOException
public java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws java.io.IOException
newDirectoryStream
in class FilterFileSystemProvider
java.io.IOException
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.