Class PathUtil
java.lang.Object
org.jboss.shrinkwrap.impl.base.path.PathUtil
PathUtil
A series of internal-only path utilities for adjusting relative forms, removing double-slashes, etc. Used in correcting inputs in the creation of new Paths
- Author:
- Aslak Knutsen, ALR
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringAdjusts the specified path to absolute form:static StringAdjusts the specified path to relative form:static StringcomposeAbsoluteContext(String base, String context) Composes an absolute context from a given base and actual context relative to the base, returning the result.static StringoptionallyAppendSlash(String path) Adds, if not already present, the absolute slash following the specified path, and returns the adjusted result.static StringoptionallyPrependSlash(String path) Adds, if not already present, the absolute slash preceding the specified path, and returns the adjusted result.static StringRemoves, if present, the absolute slash following the specified path, and returns the adjusted result.static StringRemoves, if present, the absolute slash preceding the specified path, and returns the adjusted result.
-
Field Details
-
EMPTY
-
-
Method Details
-
composeAbsoluteContext
-
adjustToRelativeDirectoryContext
-
adjustToAbsoluteDirectoryContext
-
optionallyRemovePrecedingSlash
Removes, if present, the absolute slash preceding the specified path, and returns the adjusted result.- Parameters:
path- The path from which the preceding slash should be removed- Returns:
- The path with the preceding slash removed, if it was present
-
optionallyRemoveFollowingSlash
Removes, if present, the absolute slash following the specified path, and returns the adjusted result.- Parameters:
path- The path from which the following slash should be removed- Returns:
- The path with the following slash removed, if it was present
-
optionallyAppendSlash
Adds, if not already present, the absolute slash following the specified path, and returns the adjusted result.- Parameters:
path- The path to which the trailing slash should be added- Returns:
- The path with the trailing slash added, if it was not present
-
optionallyPrependSlash
Adds, if not already present, the absolute slash preceding the specified path, and returns the adjusted result. If the argument is null, adjusts to an empty String before processing.- Parameters:
path- The path to which the preceding slash should be added- Returns:
- The path with the preceding slash added, if it was not present
-