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
AFilterFileSystemcontains 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 FileSystemdelegateThe underlyingFileSysteminstance.protected FilterFileSystemProviderparentFileSystemProvider that created this FilterFileSystem
-
Constructor Summary
Constructors Constructor Description FilterFileSystem(FilterFileSystemProvider parent, FileSystem delegate)Construct aFilterFileSystembased on the specified base filesystem.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()FileSystemgetDelegate()Returns theFileSystemwe wrap.Iterable<FileStore>getFileStores()PathgetPath(String first, String... more)PathMatchergetPathMatcher(String syntaxAndPattern)Iterable<Path>getRootDirectories()StringgetSeparator()UserPrincipalLookupServicegetUserPrincipalLookupService()booleanisOpen()booleanisReadOnly()WatchServicenewWatchService()FilterFileSystemProviderprovider()Set<String>supportedFileAttributeViews()
-
-
-
Field Detail
-
parent
protected final FilterFileSystemProvider parent
FileSystemProvider that created this FilterFileSystem
-
delegate
protected final FileSystem delegate
The underlyingFileSysteminstance.
-
-
Constructor Detail
-
FilterFileSystem
public FilterFileSystem(FilterFileSystemProvider parent, FileSystem delegate)
Construct aFilterFileSystembased 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:
providerin classFileSystem
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classFileSystem- Throws:
IOException
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin classFileSystem
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin classFileSystem
-
getSeparator
public String getSeparator()
- Specified by:
getSeparatorin classFileSystem
-
getRootDirectories
public Iterable<Path> getRootDirectories()
- Specified by:
getRootDirectoriesin classFileSystem
-
getFileStores
public Iterable<FileStore> getFileStores()
- Specified by:
getFileStoresin classFileSystem
-
supportedFileAttributeViews
public Set<String> supportedFileAttributeViews()
- Specified by:
supportedFileAttributeViewsin classFileSystem
-
getPath
public Path getPath(String first, String... more)
- Specified by:
getPathin classFileSystem
-
getPathMatcher
public PathMatcher getPathMatcher(String syntaxAndPattern)
- Specified by:
getPathMatcherin classFileSystem
-
getUserPrincipalLookupService
public UserPrincipalLookupService getUserPrincipalLookupService()
- Specified by:
getUserPrincipalLookupServicein classFileSystem
-
newWatchService
public WatchService newWatchService() throws IOException
- Specified by:
newWatchServicein classFileSystem- Throws:
IOException
-
getDelegate
public FileSystem getDelegate()
Returns theFileSystemwe wrap.
-
-