Package org.apache.lucene.tests.mockfile
Class FilterPath
java.lang.Object
org.apache.lucene.tests.mockfile.FilterPath
- All Implemented Interfaces:
Comparable<Path>,Iterable<Path>,Path,Watchable,Unwrappable<Path>
A
FilterPath contains another Path, 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 PathThe underlyingPathinstance.protected final FilterFileSystemThe parentFileSystemfor this path. -
Constructor Summary
ConstructorsConstructorDescriptionFilterPath(Path delegate, FilterFileSystem fileSystem) Construct aFilterPathwith parentfileSystem, based on the specified base path. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanbooleanbooleanGet the underlying wrapped path.getName(int index) intgetRoot()inthashCode()booleaniterator()register(WatchService watcher, WatchEvent.Kind<?>... events) register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize(Path other) final Pathfinal PathresolveSibling(String other) resolveSibling(Path other) final booleanstartsWith(String other) booleanstartsWith(Path other) subpath(int beginIndex, int endIndex) protected PathtoDelegate(Path path) Override this to customize the unboxing of Path from various operationstoFile()toRealPath(LinkOption... options) toString()toUri()unwrap()static PathUnwraps allFilterPaths, returning the innermostPath.protected final PathMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
delegate
The underlyingPathinstance. -
fileSystem
The parentFileSystemfor this path.
-
-
Constructor Details
-
FilterPath
Construct aFilterPathwith parentfileSystem, based on the specified base path.- Parameters:
delegate- specified base path.fileSystem- parent fileSystem.
-
-
Method Details
-
getDelegate
Get the underlying wrapped path.- Returns:
- wrapped path.
-
unwrap
- Specified by:
unwrapin interfaceUnwrappable<Path>
-
getFileSystem
- Specified by:
getFileSystemin interfacePath
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolutein interfacePath
-
getRoot
-
getFileName
- Specified by:
getFileNamein interfacePath
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCountin interfacePath
-
getName
-
subpath
-
startsWith
- Specified by:
startsWithin interfacePath
-
startsWith
- Specified by:
startsWithin interfacePath
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath
-
resolveSibling
- Specified by:
resolveSiblingin interfacePath
-
relativize
- Specified by:
relativizein interfacePath
-
toUri
-
toString
-
toAbsolutePath
- Specified by:
toAbsolutePathin interfacePath
-
toRealPath
- Specified by:
toRealPathin interfacePath- Throws:
IOException
-
toFile
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException - Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
register
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
iterator
-
compareTo
- Specified by:
compareToin interfaceComparable<Path>- Specified by:
compareToin interfacePath
-
hashCode
public int hashCode() -
equals
-
unwrap
Unwraps allFilterPaths, returning the innermostPath.WARNING: this is exposed for testing only!
- Parameters:
path- specified path.- Returns:
- innermost Path instance
-
wrap
-
toDelegate
Override this to customize the unboxing of Path from various operations
-