public final class PathUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EMPTY
Empty String
|
Modifier | Constructor and Description |
---|---|
private |
PathUtil()
No instantiation
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
adjustToAbsoluteDirectoryContext(java.lang.String path)
Adjusts the specified path to absolute form:
1) Adds, if not present, a preceding slash 2) Adds, if not present, a trailing slash
Null arguments are returned as-is
|
static java.lang.String |
adjustToRelativeDirectoryContext(java.lang.String path)
Adjusts the specified path to relative form:
1) Removes, if present, a preceding slash 2) Adds, if not present, a trailing slash
Null arguments are returned as-is
|
private static void |
assertSpecified(java.lang.String path)
Ensures the path is specified
|
static java.lang.String |
composeAbsoluteContext(java.lang.String base,
java.lang.String context)
Composes an absolute context from a given base and actual context relative to the base, returning the result.
|
(package private) static ArchivePath |
getParent(ArchivePath path)
Obtains the parent of this Path, if exists, else null.
|
private static boolean |
isFirstCharSlash(java.lang.String path)
Returns whether or not the first character in the specified String is a slash
|
private static boolean |
isLastCharSlash(java.lang.String path)
Returns whether or not the last character in the specified String is a slash
|
static java.lang.String |
optionallyAppendSlash(java.lang.String path)
Adds, if not already present, the absolute slash following the specified path, and returns the adjusted result.
|
static java.lang.String |
optionallyPrependSlash(java.lang.String path)
Adds, if not already present, the absolute slash preceding the specified path, and returns the adjusted result.
|
static java.lang.String |
optionallyRemoveFollowingSlash(java.lang.String path)
Removes, if present, the absolute slash following the specified path, and returns the adjusted result.
|
static java.lang.String |
optionallyRemovePrecedingSlash(java.lang.String path)
Removes, if present, the absolute slash preceding the specified path, and returns the adjusted result.
|
public static final java.lang.String EMPTY
public static java.lang.String composeAbsoluteContext(java.lang.String base, java.lang.String context)
public static java.lang.String adjustToRelativeDirectoryContext(java.lang.String path)
path
- public static java.lang.String adjustToAbsoluteDirectoryContext(java.lang.String path)
path
- public static java.lang.String optionallyRemovePrecedingSlash(java.lang.String path)
path
- public static java.lang.String optionallyRemoveFollowingSlash(java.lang.String path)
path
- public static java.lang.String optionallyAppendSlash(java.lang.String path)
path
- public static java.lang.String optionallyPrependSlash(java.lang.String path)
path
- static ArchivePath getParent(ArchivePath path)
path
- The path whose parent context we should returnprivate static boolean isFirstCharSlash(java.lang.String path)
private static boolean isLastCharSlash(java.lang.String path)
private static void assertSpecified(java.lang.String path)
path
-