|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.io.Paths
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class Paths
Provides static utility methods for path names.
| Nested Class Summary | |
|---|---|
static class |
Paths.Normalizer
A normalizer for path names. |
static class |
Paths.Splitter
Splits a given path name into its parent path name and member name. |
| Constructor Summary | |
|---|---|
private |
Paths()
You cannot instantiate this class. |
| Method Summary | |
|---|---|
static boolean |
contains(String a,
String b,
char separatorChar)
Returns true if and only if the path name represented by a
contains the path name represented by b. |
static String |
cutTrailingSeparators(String path,
char separatorChar)
Cuts off any separator characters at the end of the given path name, unless the path name contains of only separator characters, in which case a single separator character is retained to denote the root directory. |
static boolean |
isAbsolute(String path,
char separatorChar)
Returns true iff the given path name is absolute. |
static boolean |
isRoot(String path)
Returns true iff the given path name refers to the root
directory, i.e. if it's empty. |
static String |
normalize(String path,
char separatorChar)
Equivalent to new Normalizer(separatorChar). |
private static int |
prefixLength(String path,
char separatorChar)
Returns the length of the file system prefix in path. |
static Paths.Splitter |
split(String path,
char separatorChar,
boolean keepTrailingSeparator)
Equivalent to return new |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
private Paths()
| Method Detail |
|---|
public static String normalize(String path,
char separatorChar)
new Normalizer(separatorChar).normalize(path).
public static String cutTrailingSeparators(String path,
char separatorChar)
path - The path name to chop.separatorChar - The file name separator character.
path if it's a path name without trailing separators
or contains the separator character only.
Otherwise, the substring until the first of at least one
separating characters is returned.
public static Paths.Splitter split(String path,
char separatorChar,
boolean keepTrailingSeparator)
return new Splitter(separatorChar, keepTrailingSeparator).split(path);.
public static boolean isRoot(String path)
true iff the given path name refers to the root
directory, i.e. if it's empty.
public static boolean isAbsolute(String path,
char separatorChar)
true iff the given path name is absolute.
Windows drives and UNC's are always recognized by this method, even
on non-Windows platforms in order to ease interoperability.
path - the path name to test.separatorChar - the file name separator character.
private static int prefixLength(String path,
char separatorChar)
path.
File system prefixes are:
'/', two leading separators would be considered to
be a UNC and hence the return value would be 2.
path - The file system path.separatorChar - The file name separator character.
public static boolean contains(String a,
String b,
char separatorChar)
a
contains the path name represented by b.
a - A non-null String reference.b - A non-null String reference.separatorChar - The file name separator character.
|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||