@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class TPath extends Object implements java.nio.file.Path
| Modifier and Type | Field and Description |
|---|---|
private static FsMountPoint |
CURRENT_DIRECTORY |
private TArchiveDetector |
detector |
private TFileSystem |
fileSystem |
private Integer |
hashCode |
private FsPath |
path |
private URI |
uri |
| Modifier | Constructor and Description |
|---|---|
(package private) |
TPath(FsPath parent,
TArchiveDetector detector,
String first,
String... more) |
(package private) |
TPath(java.nio.file.Path path) |
|
TPath(String first,
String... more) |
(package private) |
TPath(TArchiveDetector detector,
java.nio.file.Path path) |
|
TPath(TArchiveDetector detector,
String first,
String... more) |
|
TPath(TArchiveDetector detector,
URI uri) |
private |
TPath(TArchiveDetector detector,
URI uri,
FsPath path) |
|
TPath(TPath parent,
String first,
String... more) |
|
TPath(TPath parent,
TArchiveDetector detector,
String first,
String... more) |
|
TPath(URI uri) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.nio.file.Path that) |
(package private) void |
createDirectory(java.nio.file.attribute.FileAttribute<?>... attrs) |
(package private) void |
delete() |
boolean |
endsWith(java.nio.file.Path that) |
boolean |
endsWith(String other) |
boolean |
equals(Object other) |
TArchiveDetector |
getArchiveDetector()
Returns the
TArchiveDetector that was used to detect any archive
files in the path of this TPath object at construction time. |
(package private) FsController<?> |
getController() |
static TArchiveDetector |
getDefaultArchiveDetector()
Returns the
TArchiveDetector to use if no archive detector is
explicitly passed to the constructor of a TPath instance. |
(package private) FsEntry |
getEntry() |
TPath |
getFileName() |
TFileSystem |
getFileSystem() |
InputSocket<?> |
getInputSocket(BitField<FsInputOption> options) |
TPath |
getName(int index) |
int |
getNameCount() |
OutputSocket<?> |
getOutputSocket(BitField<FsOutputOption> options,
Entry template) |
TPath |
getParent() |
(package private) FsPath |
getPath() |
TPath |
getRoot() |
(package private) URI |
getUri() |
int |
hashCode() |
private boolean |
invariants()
Checks the invariants of this class and throws an AssertionError if
any is violated even if assertion checking is disabled.
|
boolean |
isAbsolute() |
boolean |
isArchive()
Returns
true if and only if this TPath addresses an
archive file. |
boolean |
isEntry()
Returns
true if and only if this TPath addresses an
entry located within an archive file. |
Iterator<java.nio.file.Path> |
iterator() |
(package private) java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) |
TPath |
normalize() |
(package private) static TPath |
promote(java.nio.file.Path 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) |
TPath |
relativize(java.nio.file.Path other) |
java.nio.file.Path |
resolve(java.nio.file.Path other) |
TPath |
resolve(String other) |
TPath |
resolveSibling(java.nio.file.Path other) |
TPath |
resolveSibling(String other) |
static void |
setDefaultArchiveDetector(TArchiveDetector detector)
Sets the
TArchiveDetector to use if no archive detector is
explicitly passed to the constructor of a TPath instance. |
boolean |
startsWith(java.nio.file.Path that) |
boolean |
startsWith(String other) |
TPath |
subpath(int beginIndex,
int endIndex) |
TPath |
toAbsolutePath() |
TFile |
toFile() |
private FsPath |
toPath(URI uri) |
TPath |
toRealPath(java.nio.file.LinkOption... options) |
String |
toString() |
URI |
toUri() |
private static URI |
uri(String first,
String... more) |
private static final FsMountPoint CURRENT_DIRECTORY
private final TArchiveDetector detector
private final URI uri
private volatile FsPath path
private volatile TFileSystem fileSystem
private volatile Integer hashCode
public TPath(@CheckForNull
TArchiveDetector detector,
String first,
String... more)
public TPath(TPath parent, @CheckForNull TArchiveDetector detector, String first, String... more)
TPath(FsPath parent, @CheckForNull TArchiveDetector detector, String first, String... more)
public TPath(URI uri)
public TPath(@CheckForNull
TArchiveDetector detector,
URI uri)
private TPath(TArchiveDetector detector, URI uri, @CheckForNull FsPath path)
TPath(java.nio.file.Path path)
TPath(@CheckForNull
TArchiveDetector detector,
java.nio.file.Path path)
private boolean invariants()
The constructors call this method like this:
assert invariants();
This calls the method if and only if assertions are enabled in order
to assert that the instance invariants are properly obeyed.
If assertions are disabled, the call to this method is thrown away by
the HotSpot compiler, so there is no performance penalty.trueAssertionError - If assertions are enabled and any invariant is
violated.public TArchiveDetector getArchiveDetector()
TArchiveDetector that was used to detect any archive
files in the path of this TPath object at construction time.TArchiveDetector that was used to detect any archive
files in the path of this file object at construction time.public boolean isArchive()
true if and only if this TPath addresses an
archive file.
Whether or not this is true solely depends on the
TArchiveDetector which was used to construct this TPath
- no file system tests are performed by this method!true if and only if this TPath addresses an
archive file.isEntry()public boolean isEntry()
true if and only if this TPath addresses an
entry located within an archive file.
Whether or not this is true solely depends on the
TArchiveDetector which was used to construct this TPath
- no file system tests are performed by this method!true if and only if this TPath addresses an
entry located within an archive file.isArchive()public static TArchiveDetector getDefaultArchiveDetector()
TArchiveDetector to use if no archive detector is
explicitly passed to the constructor of a TPath instance.
This class property is initially set to
TArchiveDetector.ALL
TArchiveDetector to use if no archive detector is
explicitly passed to the constructor of a TPath instance.setDefaultArchiveDetector(de.schlichtherle.truezip.file.TArchiveDetector)public static void setDefaultArchiveDetector(TArchiveDetector detector)
TArchiveDetector to use if no archive detector is
explicitly passed to the constructor of a TPath instance.
When a new TPath instance is constructed, but no archive
detector is provided, then the value of this class property is used.
So changing the value of this class property affects only subsequently
constructed TPath instances - not any existing ones.detector - the TArchiveDetector to use for subsequently
constructed TPath instances if no archive detector is
explicitly provided to the constructorgetDefaultArchiveDetector()URI getUri()
FsPath getPath()
public TFileSystem getFileSystem()
getFileSystem in interface java.nio.file.Pathpublic boolean isAbsolute()
isAbsolute in interface java.nio.file.Path@Nullable public TPath getRoot()
getRoot in interface java.nio.file.Pathpublic TPath getFileName()
getFileName in interface java.nio.file.Pathpublic TPath getParent()
getParent in interface java.nio.file.Pathpublic int getNameCount()
getNameCount in interface java.nio.file.Pathpublic TPath getName(int index)
getName in interface java.nio.file.Pathpublic TPath subpath(int beginIndex, int endIndex)
subpath in interface java.nio.file.Pathstatic TPath promote(java.nio.file.Path path)
public boolean startsWith(java.nio.file.Path that)
startsWith in interface java.nio.file.Pathpublic boolean startsWith(String other)
startsWith in interface java.nio.file.Pathpublic boolean endsWith(java.nio.file.Path that)
endsWith in interface java.nio.file.Pathpublic boolean endsWith(String other)
endsWith in interface java.nio.file.Pathpublic TPath normalize()
normalize in interface java.nio.file.Pathpublic java.nio.file.Path resolve(java.nio.file.Path other)
resolve in interface java.nio.file.Pathpublic TPath resolve(String other)
resolve in interface java.nio.file.Pathpublic TPath resolveSibling(java.nio.file.Path other)
resolveSibling in interface java.nio.file.Pathpublic TPath resolveSibling(String other)
resolveSibling in interface java.nio.file.Pathpublic TPath relativize(java.nio.file.Path other)
relativize in interface java.nio.file.Pathpublic TFile toFile()
toFile in interface java.nio.file.Pathpublic URI toUri()
toUri in interface java.nio.file.Pathpublic TPath toAbsolutePath()
toAbsolutePath in interface java.nio.file.Pathpublic TPath toRealPath(java.nio.file.LinkOption... options) throws IOException
toRealPath in interface java.nio.file.PathIOExceptionpublic java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>[] events, java.nio.file.WatchEvent.Modifier... modifiers) throws IOException
register in interface java.nio.file.Pathregister in interface java.nio.file.WatchableIOExceptionpublic java.nio.file.WatchKey register(java.nio.file.WatchService watcher, java.nio.file.WatchEvent.Kind<?>... events) throws IOException
register in interface java.nio.file.Pathregister in interface java.nio.file.WatchableIOExceptionpublic Iterator<java.nio.file.Path> iterator()
iterator in interface Iterable<java.nio.file.Path>iterator in interface java.nio.file.Pathpublic boolean equals(Object other)
equals in interface java.nio.file.Pathequals in class Objectpublic int compareTo(java.nio.file.Path that)
compareTo in interface Comparable<java.nio.file.Path>compareTo in interface java.nio.file.Pathpublic int hashCode()
hashCode in interface java.nio.file.PathhashCode in class Objectpublic String toString()
toString in interface java.nio.file.PathtoString in class ObjectFsController<?> getController() throws IOException
IOExceptionFsEntry getEntry() throws IOException
IOExceptionpublic InputSocket<?> getInputSocket(BitField<FsInputOption> options)
public OutputSocket<?> getOutputSocket(BitField<FsOutputOption> options, @CheckForNull Entry template)
java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws IOException
IOExceptionvoid createDirectory(java.nio.file.attribute.FileAttribute<?>... attrs) throws IOException
IOExceptionvoid delete()
throws IOException
IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.