public class ShrinkWrapPath
extends java.lang.Object
implements java.nio.file.Path
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
DIR_BACK |
private static java.lang.String |
DIR_THIS |
private ShrinkWrapFileSystem |
fileSystem
Owning
ShrinkWrapFileSystem |
private static java.util.logging.Logger |
log |
private java.lang.String |
path
Internal representation
|
| Constructor and Description |
|---|
ShrinkWrapPath(ArchivePath path,
ShrinkWrapFileSystem fileSystem)
Constructs a new instance using the specified (required) path and backing
ShrinkWrapFileSystem |
ShrinkWrapPath(java.lang.String path,
ShrinkWrapFileSystem fileSystem)
Constructs a new instance using the specified (required) canonical form and backing
ShrinkWrapFileSystem |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.nio.file.Path other) |
private int |
countOccurrences(java.lang.String string,
char c,
int offset)
Returns the number of occurrences of the specified character in the specified
String, starting at the
specified offset |
boolean |
endsWith(java.nio.file.Path other) |
boolean |
endsWith(java.lang.String other) |
boolean |
equals(java.lang.Object obj) |
private java.nio.file.Path |
fromString(java.lang.String path)
Creates a new
ShrinkWrapPath instance from the specified input String |
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() |
private static java.lang.String |
normalize(java.util.List<java.lang.String> path,
boolean absolute)
Normalizes the tokenized view of the path
|
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) |
private static ShrinkWrapPath |
relativizeCommonRoot(ShrinkWrapPath thisOriginal,
java.nio.file.Path thisCurrent,
java.nio.file.Path otherOriginal,
java.nio.file.Path otherCurrent,
int backupCount)
Relativizes the paths recursively
|
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()
Resolves relative paths against the root directory, normalizing as well.
|
java.io.File |
toFile() |
private static java.util.List<java.lang.String> |
tokenize(ShrinkWrapPath path)
Returns the components of this path in order from root out
|
java.nio.file.Path |
toRealPath(java.nio.file.LinkOption... options) |
java.lang.String |
toString() |
java.net.URI |
toUri() |
private static final java.util.logging.Logger log
private static final java.lang.String DIR_BACK
private static final java.lang.String DIR_THIS
private final java.lang.String path
private final ShrinkWrapFileSystem fileSystem
ShrinkWrapFileSystemShrinkWrapPath(java.lang.String path,
ShrinkWrapFileSystem fileSystem)
throws java.lang.IllegalArgumentException
ShrinkWrapFileSystempath - fileSystem - java.lang.IllegalArgumentException - If the path or file system is not specifiedShrinkWrapPath(ArchivePath path, ShrinkWrapFileSystem fileSystem) throws java.lang.IllegalArgumentException
ShrinkWrapFileSystempath - to be evaluated using ArchivePath.get()fileSystem - java.lang.IllegalArgumentException - If the path or file system is not specifiedjava.lang.IllegalArgumentException - If the delegate is not specifiedpublic java.nio.file.FileSystem getFileSystem()
getFileSystem in interface java.nio.file.PathPath.getFileSystem()public boolean isAbsolute()
isAbsolute in interface java.nio.file.PathPath.isAbsolute()public java.nio.file.Path getRoot()
getRoot in interface java.nio.file.PathPath.getRoot()public java.nio.file.Path getFileName()
getFileName in interface java.nio.file.PathPath.getFileName()public java.nio.file.Path getParent()
getParent in interface java.nio.file.PathPath.getParent()public int getNameCount()
getNameCount in interface java.nio.file.PathPath.getNameCount()private int countOccurrences(java.lang.String string,
char c,
int offset)
String, starting at the
specified offsetstring - c - offset - public java.nio.file.Path getName(int index)
getName in interface java.nio.file.PathPath.getName(int)public java.nio.file.Path subpath(int beginIndex,
int endIndex)
subpath in interface java.nio.file.PathPath.subpath(int, int)public boolean startsWith(java.nio.file.Path other)
startsWith in interface java.nio.file.PathPath.startsWith(java.nio.file.Path)public boolean startsWith(java.lang.String other)
startsWith in interface java.nio.file.PathPath.startsWith(java.lang.String)public boolean endsWith(java.nio.file.Path other)
endsWith in interface java.nio.file.PathPath.endsWith(java.nio.file.Path)public boolean endsWith(java.lang.String other)
endsWith in interface java.nio.file.PathPath.endsWith(java.lang.String)public java.nio.file.Path normalize()
normalize in interface java.nio.file.PathPath.normalize()public java.nio.file.Path resolve(java.nio.file.Path other)
resolve in interface java.nio.file.PathPath.resolve(java.nio.file.Path)public java.nio.file.Path resolve(java.lang.String other)
resolve in interface java.nio.file.PathPath.resolve(java.lang.String)public java.nio.file.Path resolveSibling(java.nio.file.Path other)
resolveSibling in interface java.nio.file.PathPath.resolveSibling(java.nio.file.Path)public java.nio.file.Path resolveSibling(java.lang.String other)
resolveSibling in interface java.nio.file.PathPath.resolveSibling(java.lang.String)public java.nio.file.Path relativize(java.nio.file.Path other)
relativize in interface java.nio.file.PathPath.relativize(java.nio.file.Path)public java.net.URI toUri()
toUri in interface java.nio.file.PathPath.toUri()public java.nio.file.Path toAbsolutePath()
toAbsolutePath in interface java.nio.file.PathPath.toAbsolutePath()public java.nio.file.Path toRealPath(java.nio.file.LinkOption... options)
throws java.io.IOException
toRealPath in interface java.nio.file.Pathjava.io.IOExceptionPath.toRealPath(java.nio.file.LinkOption[])public java.io.File toFile()
toFile in interface java.nio.file.PathPath.toFile()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.Pathregister in interface java.nio.file.Watchablejava.io.IOExceptionPath.register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>[],
java.nio.file.WatchEvent.Modifier[])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.Pathregister in interface java.nio.file.Watchablejava.io.IOExceptionPath.register(java.nio.file.WatchService, java.nio.file.WatchEvent.Kind<?>[])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.PathPath.iterator()public int compareTo(java.nio.file.Path other)
compareTo in interface java.lang.Comparable<java.nio.file.Path>compareTo in interface java.nio.file.PathPath.compareTo(java.nio.file.Path)public java.lang.String toString()
toString in interface java.nio.file.PathtoString in class java.lang.ObjectPath.toString()private java.nio.file.Path fromString(java.lang.String path)
ShrinkWrapPath instance from the specified input Stringpath - private static java.util.List<java.lang.String> tokenize(ShrinkWrapPath path)
private static java.lang.String normalize(java.util.List<java.lang.String> path,
boolean absolute)
path - private static ShrinkWrapPath relativizeCommonRoot(ShrinkWrapPath thisOriginal, java.nio.file.Path thisCurrent, java.nio.file.Path otherOriginal, java.nio.file.Path otherCurrent, int backupCount)
thisOriginal - thisCurrent - otherOriginal - otherCurrent - backupCount - public int hashCode()
hashCode in interface java.nio.file.PathhashCode in class java.lang.ObjectObject.hashCode()public boolean equals(java.lang.Object obj)
equals in interface java.nio.file.Pathequals in class java.lang.ObjectObject.equals(java.lang.Object)