Package org.apache.lucene.tests.mockfile
Class FilterFileSystem
- java.lang.Object
-
- java.nio.file.FileSystem
-
- org.apache.lucene.tests.mockfile.FilterFileSystem
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class FilterFileSystem extends FileSystem
AFilterFileSystem
contains anotherFileSystem
, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.
-
-
Field Summary
Fields Modifier and Type Field Description protected FileSystem
delegate
The underlyingFileSystem
instance.protected FilterFileSystemProvider
parent
FileSystemProvider that created this FilterFileSystem
-
Constructor Summary
Constructors Constructor Description FilterFileSystem(FilterFileSystemProvider parent, FileSystem delegate)
Construct aFilterFileSystem
based on the specified base filesystem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
FileSystem
getDelegate()
Returns theFileSystem
we wrap.Iterable<FileStore>
getFileStores()
Path
getPath(String first, String... more)
PathMatcher
getPathMatcher(String syntaxAndPattern)
Iterable<Path>
getRootDirectories()
String
getSeparator()
UserPrincipalLookupService
getUserPrincipalLookupService()
boolean
isOpen()
boolean
isReadOnly()
WatchService
newWatchService()
FilterFileSystemProvider
provider()
Set<String>
supportedFileAttributeViews()
-
-
-
Field Detail
-
parent
protected final FilterFileSystemProvider parent
FileSystemProvider that created this FilterFileSystem
-
delegate
protected final FileSystem delegate
The underlyingFileSystem
instance.
-
-
Constructor Detail
-
FilterFileSystem
public FilterFileSystem(FilterFileSystemProvider parent, FileSystem delegate)
Construct aFilterFileSystem
based on the specified base filesystem.Note that base filesystem is closed if this filesystem is closed, however the default filesystem provider will never be closed, it doesn't support that.
- Parameters:
delegate
- specified base channel.
-
-
Method Detail
-
provider
public FilterFileSystemProvider provider()
- Specified by:
provider
in classFileSystem
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classFileSystem
- Throws:
IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpen
in classFileSystem
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in classFileSystem
-
getSeparator
public String getSeparator()
- Specified by:
getSeparator
in classFileSystem
-
getRootDirectories
public Iterable<Path> getRootDirectories()
- Specified by:
getRootDirectories
in classFileSystem
-
getFileStores
public Iterable<FileStore> getFileStores()
- Specified by:
getFileStores
in classFileSystem
-
supportedFileAttributeViews
public Set<String> supportedFileAttributeViews()
- Specified by:
supportedFileAttributeViews
in classFileSystem
-
getPath
public Path getPath(String first, String... more)
- Specified by:
getPath
in classFileSystem
-
getPathMatcher
public PathMatcher getPathMatcher(String syntaxAndPattern)
- Specified by:
getPathMatcher
in classFileSystem
-
getUserPrincipalLookupService
public UserPrincipalLookupService getUserPrincipalLookupService()
- Specified by:
getUserPrincipalLookupService
in classFileSystem
-
newWatchService
public WatchService newWatchService() throws IOException
- Specified by:
newWatchService
in classFileSystem
- Throws:
IOException
-
getDelegate
public FileSystem getDelegate()
Returns theFileSystem
we wrap.
-
-