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
ShrinkWrapFileSystem
ShrinkWrapPath(java.lang.String path, ShrinkWrapFileSystem fileSystem) throws java.lang.IllegalArgumentException
ShrinkWrapFileSystem
path
- fileSystem
- java.lang.IllegalArgumentException
- If the path or file system is not specifiedShrinkWrapPath(ArchivePath path, ShrinkWrapFileSystem fileSystem) throws java.lang.IllegalArgumentException
ShrinkWrapFileSystem
path
- 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.Path
Path.getFileSystem()
public boolean isAbsolute()
isAbsolute
in interface java.nio.file.Path
Path.isAbsolute()
public java.nio.file.Path getRoot()
getRoot
in interface java.nio.file.Path
Path.getRoot()
public java.nio.file.Path getFileName()
getFileName
in interface java.nio.file.Path
Path.getFileName()
public java.nio.file.Path getParent()
getParent
in interface java.nio.file.Path
Path.getParent()
public int getNameCount()
getNameCount
in interface java.nio.file.Path
Path.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.Path
Path.getName(int)
public java.nio.file.Path subpath(int beginIndex, int endIndex)
subpath
in interface java.nio.file.Path
Path.subpath(int, int)
public boolean startsWith(java.nio.file.Path other)
startsWith
in interface java.nio.file.Path
Path.startsWith(java.nio.file.Path)
public boolean startsWith(java.lang.String other)
startsWith
in interface java.nio.file.Path
Path.startsWith(java.lang.String)
public boolean endsWith(java.nio.file.Path other)
endsWith
in interface java.nio.file.Path
Path.endsWith(java.nio.file.Path)
public boolean endsWith(java.lang.String other)
endsWith
in interface java.nio.file.Path
Path.endsWith(java.lang.String)
public java.nio.file.Path normalize()
normalize
in interface java.nio.file.Path
Path.normalize()
public java.nio.file.Path resolve(java.nio.file.Path other)
resolve
in interface java.nio.file.Path
Path.resolve(java.nio.file.Path)
public java.nio.file.Path resolve(java.lang.String other)
resolve
in interface java.nio.file.Path
Path.resolve(java.lang.String)
public java.nio.file.Path resolveSibling(java.nio.file.Path other)
resolveSibling
in interface java.nio.file.Path
Path.resolveSibling(java.nio.file.Path)
public java.nio.file.Path resolveSibling(java.lang.String other)
resolveSibling
in interface java.nio.file.Path
Path.resolveSibling(java.lang.String)
public java.nio.file.Path relativize(java.nio.file.Path other)
relativize
in interface java.nio.file.Path
Path.relativize(java.nio.file.Path)
public java.net.URI toUri()
toUri
in interface java.nio.file.Path
Path.toUri()
public java.nio.file.Path toAbsolutePath()
toAbsolutePath
in interface java.nio.file.Path
Path.toAbsolutePath()
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
Path.toRealPath(java.nio.file.LinkOption[])
public java.io.File toFile()
toFile
in interface java.nio.file.Path
Path.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.Path
register
in interface java.nio.file.Watchable
java.io.IOException
Path.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.Path
register
in interface java.nio.file.Watchable
java.io.IOException
Path.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.Path
Path.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.Path
Path.compareTo(java.nio.file.Path)
public java.lang.String toString()
toString
in interface java.nio.file.Path
toString
in class java.lang.Object
Path.toString()
private java.nio.file.Path fromString(java.lang.String path)
ShrinkWrapPath
instance from the specified input String
path
- 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.Path
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object obj)
equals
in interface java.nio.file.Path
equals
in class java.lang.Object
Object.equals(java.lang.Object)