public final class PathUtils
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
private |
PathUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
canonicalize(java.lang.String path)
Canonicalize the given path.
|
static <T extends java.util.Collection<? super java.lang.String>> |
filterPaths(java.lang.Iterable<java.lang.String> source,
PathFilter filter,
T target)
Filter the paths from
source into target using filter. |
static java.util.Set<java.lang.String> |
getPathSet(java.lang.ClassLoader classLoader)
Attempt to get a set of all paths defined directly by the given class loader.
|
static boolean |
isChild(java.lang.String parent,
java.lang.String child)
Determine whether one path is a child of another.
|
static boolean |
isDirectChild(java.lang.String parent,
java.lang.String child)
Determine whether one path is a direct (or immediate) child of another.
|
static boolean |
isRelative(java.lang.String path)
Determine whether a path name is relative.
|
static boolean |
isSeparator(char ch)
Determine whether the given character is a
/ or a platform-specific separator. |
static java.lang.String |
relativize(java.lang.String path)
Relativize the given path.
|
public static <T extends java.util.Collection<? super java.lang.String>> T filterPaths(java.lang.Iterable<java.lang.String> source,
PathFilter filter,
T target)
source into target using filter.T - the collection typesource - the source pathsfilter - the filter to applytarget - the destination for filtered pathstarget setpublic static java.util.Set<java.lang.String> getPathSet(java.lang.ClassLoader classLoader)
null is returned.classLoader - the class loader to inspectnull if the paths could not be determinedpublic static java.lang.String relativize(java.lang.String path)
/ segments from the path.path - the path to relativizepublic static java.lang.String canonicalize(java.lang.String path)
. and .. segments from the path.path - the relative or absolute possibly non-canonical pathpublic static boolean isChild(java.lang.String parent,
java.lang.String child)
parent - the parent pathchild - the child pathtrue if the child is truly a child of parentpublic static boolean isDirectChild(java.lang.String parent,
java.lang.String child)
parent - the parent pathchild - the child pathtrue if the child is truly a direct child of parentpublic static boolean isRelative(java.lang.String path)
path - the path nametrue if it is relativepublic static boolean isSeparator(char ch)
/ or a platform-specific separator.ch - the character to testtrue if it is a separator