Package org.apache.lucene.mockfile
Class FilterPath
- java.lang.Object
-
- org.apache.lucene.mockfile.FilterPath
-
-
Field Summary
Fields Modifier and Type Field Description protected PathdelegateThe underlyingPathinstance.protected FileSystemfileSystemThe parentFileSystemfor this path.
-
Constructor Summary
Constructors Constructor Description FilterPath(Path delegate, FileSystem fileSystem)Construct aFilterPathwith parentfileSystem, based on the specified base path.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Path other)booleanendsWith(String other)booleanendsWith(Path other)booleanequals(Object obj)PathgetDelegate()Get the underlying wrapped path.PathgetFileName()FileSystemgetFileSystem()PathgetName(int index)intgetNameCount()PathgetParent()PathgetRoot()inthashCode()booleanisAbsolute()Iterator<Path>iterator()Pathnormalize()WatchKeyregister(WatchService watcher, WatchEvent.Kind<?>... events)WatchKeyregister(WatchService watcher, WatchEvent.Kind<?>[] events, WatchEvent.Modifier... modifiers)Pathrelativize(Path other)Pathresolve(String other)Pathresolve(Path other)PathresolveSibling(String other)PathresolveSibling(Path other)booleanstartsWith(String other)booleanstartsWith(Path other)Pathsubpath(int beginIndex, int endIndex)PathtoAbsolutePath()protected PathtoDelegate(Path path)Override this to customize the unboxing of Path from various operationsFiletoFile()PathtoRealPath(LinkOption... options)StringtoString()URItoUri()static Pathunwrap(Path path)Unwraps allFilterPaths, returning the innermostPath.protected Pathwrap(Path other)Override this to customize the return wrapped path from various operations-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
delegate
protected final Path delegate
The underlyingPathinstance.
-
fileSystem
protected final FileSystem fileSystem
The parentFileSystemfor this path.
-
-
Constructor Detail
-
FilterPath
public FilterPath(Path delegate, FileSystem fileSystem)
Construct aFilterPathwith parentfileSystem, based on the specified base path.- Parameters:
delegate- specified base path.fileSystem- parent fileSystem.
-
-
Method Detail
-
getDelegate
public Path getDelegate()
Get the underlying wrapped path.- Returns:
- wrapped path.
-
getFileSystem
public FileSystem getFileSystem()
- Specified by:
getFileSystemin interfacePath
-
isAbsolute
public boolean isAbsolute()
- Specified by:
isAbsolutein interfacePath
-
getFileName
public Path getFileName()
- Specified by:
getFileNamein interfacePath
-
getNameCount
public int getNameCount()
- Specified by:
getNameCountin interfacePath
-
startsWith
public boolean startsWith(Path other)
- Specified by:
startsWithin interfacePath
-
startsWith
public boolean startsWith(String other)
- Specified by:
startsWithin interfacePath
-
resolveSibling
public Path resolveSibling(Path other)
- Specified by:
resolveSiblingin interfacePath
-
resolveSibling
public Path resolveSibling(String other)
- Specified by:
resolveSiblingin interfacePath
-
relativize
public Path relativize(Path other)
- Specified by:
relativizein interfacePath
-
toString
public String toString()
-
toAbsolutePath
public Path toAbsolutePath()
- Specified by:
toAbsolutePathin interfacePath
-
toRealPath
public Path toRealPath(LinkOption... options) throws IOException
- Specified by:
toRealPathin interfacePath- Throws:
IOException
-
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
public WatchKey register(WatchService watcher, WatchEvent.Kind<?>... events) throws IOException
- Specified by:
registerin interfacePath- Specified by:
registerin interfaceWatchable- Throws:
IOException
-
compareTo
public int compareTo(Path other)
- Specified by:
compareToin interfaceComparable<Path>- Specified by:
compareToin interfacePath
-
hashCode
public int hashCode()
-
equals
public boolean equals(Object obj)
-
unwrap
public static Path unwrap(Path path)
Unwraps allFilterPaths, returning the innermostPath.WARNING: this is exposed for testing only!
- Parameters:
path- specified path.- Returns:
- innermost Path instance
-
wrap
protected Path wrap(Path other)
Override this to customize the return wrapped path from various operations
-
-