Package org.apache.lucene.tests.mockfile
Class FilterFileSystemProvider
java.lang.Object
java.nio.file.spi.FileSystemProvider
org.apache.lucene.tests.mockfile.FilterFileSystemProvider
- Direct Known Subclasses:
DisableFsyncFS,ExtrasFS,HandleTrackingFS,ShuffleFS,VerboseFS,VirusCheckingFS
A
FilterFileSystemProvider contains another FileSystemProvider, which it uses as
its basic source of data, possibly transforming the data along the way or providing additional
functionality.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FileSystemProviderThe underlyingFileSystemProvider.protected FilterFileSystemThe underlyingFileSysteminstance.protected final StringThe URI scheme for this provider. -
Constructor Summary
ConstructorsConstructorDescriptionFilterFileSystemProvider(String scheme, FileSystem delegateInstance) Construct aFilterFileSystemProviderindicated by the specifiedschemeand wrapping functionality of the provider of the specified base filesystem.FilterFileSystemProvider(String scheme, FileSystemProvider delegate) Construct aFilterFileSystemProviderindicated by the specifiedschemeand wrapping functionality of the provider. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckAccess(Path path, AccessMode... modes) voidcopy(Path source, Path target, CopyOption... options) voidcreateDirectory(Path dir, FileAttribute<?>... attrs) voidcreateLink(Path link, Path existing) voidcreateSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) voidbooleandeleteIfExists(Path path) <V extends FileAttributeView>
VgetFileAttributeView(Path path, Class<V> type, LinkOption... options) getFileStore(Path path) getFileSystem(URI uri) booleanbooleanisSameFile(Path path, Path path2) voidmove(Path source, Path target, CopyOption... options) newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) newFileSystem(URI uri, Map<String, ?> env) newFileSystem(Path path, Map<String, ?> env) newInputStream(Path path, OpenOption... options) newOutputStream(Path path, OpenOption... options) protected voidonClose()Override to trigger some behavior when the filesystem is closed.<A extends BasicFileAttributes>
AreadAttributes(Path path, Class<A> type, LinkOption... options) readAttributes(Path path, String attributes, LinkOption... options) readSymbolicLink(Path link) voidsetAttribute(Path path, String attribute, Object value, LinkOption... options) protected PathtoDelegate(Path path) toString()wraps a Path with provider-specific behaviorMethods inherited from class java.nio.file.spi.FileSystemProvider
exists, installedProviders, readAttributesIfExists
-
Field Details
-
delegate
The underlyingFileSystemProvider. -
fileSystem
The underlyingFileSysteminstance. -
scheme
The URI scheme for this provider.
-
-
Constructor Details
-
FilterFileSystemProvider
Construct aFilterFileSystemProviderindicated by the specifiedschemeand wrapping functionality of the provider of the specified base filesystem.- Parameters:
scheme- URI schemedelegateInstance- specified base filesystem.
-
FilterFileSystemProvider
Construct aFilterFileSystemProviderindicated by the specifiedschemeand wrapping functionality of the provider. You must set the singletonfilesystemyourself.- Parameters:
scheme- URI schemedelegate- specified base provider.
-
-
Method Details
-
getScheme
- Specified by:
getSchemein classFileSystemProvider
-
newFileSystem
- Specified by:
newFileSystemin classFileSystemProvider- Throws:
IOException
-
newFileSystem
- Overrides:
newFileSystemin classFileSystemProvider- Throws:
IOException
-
getFileSystem
- Specified by:
getFileSystemin classFileSystemProvider
-
getPath
- Specified by:
getPathin classFileSystemProvider
-
wrapPath
wraps a Path with provider-specific behavior -
createDirectory
- Specified by:
createDirectoryin classFileSystemProvider- Throws:
IOException
-
delete
- Specified by:
deletein classFileSystemProvider- Throws:
IOException
-
copy
- Specified by:
copyin classFileSystemProvider- Throws:
IOException
-
move
- Specified by:
movein classFileSystemProvider- Throws:
IOException
-
isSameFile
- Specified by:
isSameFilein classFileSystemProvider- Throws:
IOException
-
isHidden
- Specified by:
isHiddenin classFileSystemProvider- Throws:
IOException
-
getFileStore
- Specified by:
getFileStorein classFileSystemProvider- Throws:
IOException
-
checkAccess
- Specified by:
checkAccessin classFileSystemProvider- Throws:
IOException
-
getFileAttributeView
public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options) - Specified by:
getFileAttributeViewin classFileSystemProvider
-
readAttributes
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException
-
readAttributes
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException - Specified by:
readAttributesin classFileSystemProvider- Throws:
IOException
-
setAttribute
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException - Specified by:
setAttributein classFileSystemProvider- Throws:
IOException
-
newInputStream
- Overrides:
newInputStreamin classFileSystemProvider- Throws:
IOException
-
newOutputStream
- Overrides:
newOutputStreamin classFileSystemProvider- Throws:
IOException
-
newFileChannel
public FileChannel newFileChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Overrides:
newFileChannelin classFileSystemProvider- Throws:
IOException
-
newAsynchronousFileChannel
public AsynchronousFileChannel newAsynchronousFileChannel(Path path, Set<? extends OpenOption> options, ExecutorService executor, FileAttribute<?>... attrs) throws IOException - Overrides:
newAsynchronousFileChannelin classFileSystemProvider- Throws:
IOException
-
newByteChannel
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException - Specified by:
newByteChannelin classFileSystemProvider- Throws:
IOException
-
newDirectoryStream
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException - Specified by:
newDirectoryStreamin classFileSystemProvider- Throws:
IOException
-
createSymbolicLink
public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException - Overrides:
createSymbolicLinkin classFileSystemProvider- Throws:
IOException
-
createLink
- Overrides:
createLinkin classFileSystemProvider- Throws:
IOException
-
deleteIfExists
- Overrides:
deleteIfExistsin classFileSystemProvider- Throws:
IOException
-
readSymbolicLink
- Overrides:
readSymbolicLinkin classFileSystemProvider- Throws:
IOException
-
toDelegate
-
onClose
protected void onClose()Override to trigger some behavior when the filesystem is closed.This is always called for each FilterFileSystemProvider in the chain.
-
toString
-