public class FilterPath
extends java.lang.Object
implements java.nio.file.Path
FilterPath
contains another
Path
, which it uses as its basic
source of data, possibly transforming the data along the
way or providing additional functionality.Modifier and Type | Field and Description |
---|---|
protected java.nio.file.Path |
delegate
The underlying
Path instance. |
protected java.nio.file.FileSystem |
fileSystem
The parent
FileSystem for this path. |
Constructor and Description |
---|
FilterPath(java.nio.file.Path delegate,
java.nio.file.FileSystem fileSystem)
Construct a
FilterPath with parent
fileSystem , based on the specified base path. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.nio.file.Path other) |
boolean |
endsWith(java.nio.file.Path other) |
boolean |
endsWith(java.lang.String other) |
boolean |
equals(java.lang.Object obj) |
java.nio.file.Path |
getDelegate()
Get the underlying wrapped path.
|
java.nio.file.Path |
getFileName() |
java.nio.file.FileSystem |
getFileSystem() |
java.nio.file.Path |
getName(int index) |
int |
getNameCount() |
java.nio.file.Path |
getParent() |
java.nio.file.Path |
getRoot() |
int |
hashCode() |
boolean |
isAbsolute() |
java.util.Iterator<java.nio.file.Path> |
iterator() |
java.nio.file.Path |
normalize() |
java.nio.file.WatchKey |
register(java.nio.file.WatchService watcher,
java.nio.file.WatchEvent.Kind<?>... events) |
java.nio.file.WatchKey |
register(java.nio.file.WatchService watcher,
java.nio.file.WatchEvent.Kind<?>[] events,
java.nio.file.WatchEvent.Modifier... modifiers) |
java.nio.file.Path |
relativize(java.nio.file.Path other) |
java.nio.file.Path |
resolve(java.nio.file.Path other) |
java.nio.file.Path |
resolve(java.lang.String other) |
java.nio.file.Path |
resolveSibling(java.nio.file.Path other) |
java.nio.file.Path |
resolveSibling(java.lang.String other) |
boolean |
startsWith(java.nio.file.Path other) |
boolean |
startsWith(java.lang.String other) |
java.nio.file.Path |
subpath(int beginIndex,
int endIndex) |
java.nio.file.Path |
toAbsolutePath() |
protected java.nio.file.Path |
toDelegate(java.nio.file.Path path)
Override this to customize the unboxing of Path
from various operations
|
java.io.File |
toFile() |
java.nio.file.Path |
toRealPath(java.nio.file.LinkOption... options) |
java.lang.String |
toString() |
java.net.URI |
toUri() |
static java.nio.file.Path |
unwrap(java.nio.file.Path path)
Unwraps all
FilterPath s, returning
the innermost Path . |
protected java.nio.file.Path |
wrap(java.nio.file.Path other)
Override this to customize the return wrapped
path from various operations
|
protected final java.nio.file.Path delegate
Path
instance.protected final java.nio.file.FileSystem fileSystem
FileSystem
for this path.public FilterPath(java.nio.file.Path delegate, java.nio.file.FileSystem fileSystem)
FilterPath
with parent
fileSystem
, based on the specified base path.delegate
- specified base path.fileSystem
- parent fileSystem.public java.nio.file.Path getDelegate()
public java.nio.file.FileSystem getFileSystem()
getFileSystem
in interface java.nio.file.Path
public boolean isAbsolute()
isAbsolute
in interface java.nio.file.Path
public java.nio.file.Path getRoot()
getRoot
in interface java.nio.file.Path
public java.nio.file.Path getFileName()
getFileName
in interface java.nio.file.Path
public java.nio.file.Path getParent()
getParent
in interface java.nio.file.Path
public int getNameCount()
getNameCount
in interface java.nio.file.Path
public java.nio.file.Path getName(int index)
getName
in interface java.nio.file.Path
public java.nio.file.Path subpath(int beginIndex, int endIndex)
subpath
in interface java.nio.file.Path
public boolean startsWith(java.nio.file.Path other)
startsWith
in interface java.nio.file.Path
public boolean startsWith(java.lang.String other)
startsWith
in interface java.nio.file.Path
public boolean endsWith(java.nio.file.Path other)
endsWith
in interface java.nio.file.Path
public boolean endsWith(java.lang.String other)
endsWith
in interface java.nio.file.Path
public java.nio.file.Path normalize()
normalize
in interface java.nio.file.Path
public java.nio.file.Path resolve(java.nio.file.Path other)
resolve
in interface java.nio.file.Path
public java.nio.file.Path resolve(java.lang.String other)
resolve
in interface java.nio.file.Path
public java.nio.file.Path resolveSibling(java.nio.file.Path other)
resolveSibling
in interface java.nio.file.Path
public java.nio.file.Path resolveSibling(java.lang.String other)
resolveSibling
in interface java.nio.file.Path
public java.nio.file.Path relativize(java.nio.file.Path other)
relativize
in interface java.nio.file.Path
public java.net.URI toUri()
toUri
in interface java.nio.file.Path
public java.lang.String toString()
toString
in interface java.nio.file.Path
toString
in class java.lang.Object
public java.nio.file.Path toAbsolutePath()
toAbsolutePath
in interface java.nio.file.Path
public java.nio.file.Path toRealPath(java.nio.file.LinkOption... options) throws java.io.IOException
toRealPath
in interface java.nio.file.Path
java.io.IOException
public java.io.File toFile()
toFile
in interface java.nio.file.Path
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers) throws java.io.IOException
register
in interface java.nio.file.Path
register
in interface java.nio.file.Watchable
java.io.IOException
public java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events) throws java.io.IOException
register
in interface java.nio.file.Path
register
in interface java.nio.file.Watchable
java.io.IOException
public java.util.Iterator<java.nio.file.Path> iterator()
iterator
in interface java.lang.Iterable<java.nio.file.Path>
iterator
in interface java.nio.file.Path
public int compareTo(java.nio.file.Path other)
compareTo
in interface java.lang.Comparable<java.nio.file.Path>
compareTo
in interface java.nio.file.Path
public int hashCode()
hashCode
in interface java.nio.file.Path
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.nio.file.Path
equals
in class java.lang.Object
public static java.nio.file.Path unwrap(java.nio.file.Path path)
FilterPath
s, returning
the innermost Path
.
WARNING: this is exposed for testing only!
path
- specified path.protected java.nio.file.Path wrap(java.nio.file.Path other)
protected java.nio.file.Path toDelegate(java.nio.file.Path path)
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.