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
Modifier and TypeFieldDescriptionprotected final Path
The underlyingPath
instance.protected final FileSystem
The parentFileSystem
for this path. -
Constructor Summary
ConstructorDescriptionFilterPath
(Path delegate, FileSystem fileSystem) Construct aFilterPath
with parentfileSystem
, based on the specified base path. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
boolean
boolean
Get the underlying wrapped path.getName
(int index) int
getRoot()
int
hashCode()
boolean
iterator()
register
(WatchService watcher, WatchEvent.Kind<?>... events) register
(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) relativize
(Path other) resolveSibling
(String other) resolveSibling
(Path other) boolean
startsWith
(String other) boolean
startsWith
(Path other) subpath
(int beginIndex, int endIndex) protected Path
toDelegate
(Path path) Override this to customize the unboxing of Path from various operationstoFile()
toRealPath
(LinkOption... options) toString()
toUri()
unwrap()
static Path
Unwraps allFilterPath
s, returning the innermostPath
.protected Path
Override this to customize the return wrapped path from various operationsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
delegate
The underlyingPath
instance. -
fileSystem
The parentFileSystem
for this path.
-
-
Constructor Details
-
FilterPath
Construct aFilterPath
with 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:
unwrap
in interfaceUnwrappable<Path>
-
getFileSystem
- Specified by:
getFileSystem
in interfacePath
-
isAbsolute
public boolean isAbsolute()- Specified by:
isAbsolute
in interfacePath
-
getRoot
-
getFileName
- Specified by:
getFileName
in interfacePath
-
getParent
-
getNameCount
public int getNameCount()- Specified by:
getNameCount
in interfacePath
-
getName
-
subpath
-
startsWith
- Specified by:
startsWith
in interfacePath
-
startsWith
- Specified by:
startsWith
in interfacePath
-
endsWith
-
endsWith
-
normalize
-
resolve
-
resolve
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
-
resolveSibling
- Specified by:
resolveSibling
in interfacePath
-
relativize
- Specified by:
relativize
in interfacePath
-
toUri
-
toString
-
toAbsolutePath
- Specified by:
toAbsolutePath
in interfacePath
-
toRealPath
- Specified by:
toRealPath
in interfacePath
- Throws:
IOException
-
toFile
-
register
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers) throws IOException - Specified by:
register
in interfacePath
- Specified by:
register
in interfaceWatchable
- Throws:
IOException
-
register
- Specified by:
register
in interfacePath
- Specified by:
register
in interfaceWatchable
- Throws:
IOException
-
iterator
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Path>
- Specified by:
compareTo
in interfacePath
-
hashCode
public int hashCode() -
equals
-
unwrap
Unwraps allFilterPath
s, returning the innermostPath
.WARNING: this is exposed for testing only!
- Parameters:
path
- specified path.- Returns:
- innermost Path instance
-
wrap
Override this to customize the return wrapped path from various operations -
toDelegate
Override this to customize the unboxing of Path from various operations
-