public class PathUtil extends Object
PathUtil class provides static helper functions useful for working
with directory paths.| Constructor and Description |
|---|
PathUtil() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
extend(List<String> path,
String... subPaths)
Extends a path by an arbitrary number of elements.
|
static List<String> |
from(String... subPaths)
Creates a new path from an arbitrary number of elements.
|
static List<String> |
join(List<String> path1,
List<String> path2)
Joins two paths into one larger path.
|
static List<String> |
popBack(List<String> path)
Removes the last item from a path.
|
static List<String> |
popFront(List<String> path)
Removes the first item from a path.
|
public static List<String> join(List<String> path1, List<String> path2)
path1 - The first path to joinpath2 - The path to append to path1path1 followed
by all the items in path2public static List<String> extend(List<String> path, String... subPaths)
path - The path to extendsubPaths - The items to append to pathpath followed
by all additional items specified in subPathspublic static List<String> from(String... subPaths)
subPaths - The items in the pathsubPathspublic static List<String> popFront(List<String> path)
path - the path whose first item is being poppedpath except
for the first item