Package com.apple.foundationdb.directory
Class PathUtil
- java.lang.Object
-
- com.apple.foundationdb.directory.PathUtil
-
public class PathUtil extends java.lang.ObjectThePathUtilclass provides static helper functions useful for working with directory paths.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.String>extend(java.util.List<java.lang.String> path, java.lang.String... subPaths)Extends a path by an arbitrary number of elements.static java.util.List<java.lang.String>from(java.lang.String... subPaths)Creates a new path from an arbitrary number of elements.static java.util.List<java.lang.String>join(java.util.List<java.lang.String> path1, java.util.List<java.lang.String> path2)Joins two paths into one larger path.static java.util.List<java.lang.String>popBack(java.util.List<java.lang.String> path)Removes the last item from a path.static java.util.List<java.lang.String>popFront(java.util.List<java.lang.String> path)Removes the first item from a path.
-
-
-
Method Detail
-
join
public static java.util.List<java.lang.String> join(java.util.List<java.lang.String> path1, java.util.List<java.lang.String> path2)Joins two paths into one larger path.- Parameters:
path1- The first path to joinpath2- The path to append topath1- Returns:
- a new list which contains all the items in
path1followed by all the items inpath2
-
extend
public static java.util.List<java.lang.String> extend(java.util.List<java.lang.String> path, java.lang.String... subPaths)Extends a path by an arbitrary number of elements.- Parameters:
path- The path to extendsubPaths- The items to append to path- Returns:
- a new list which contains all the items in
pathfollowed by all additional items specified insubPaths
-
from
public static java.util.List<java.lang.String> from(java.lang.String... subPaths)
Creates a new path from an arbitrary number of elements.- Parameters:
subPaths- The items in the path- Returns:
- a list which contains all the items specified in
subPaths
-
popFront
public static java.util.List<java.lang.String> popFront(java.util.List<java.lang.String> path)
Removes the first item from a path.- Parameters:
path- the path whose first item is being popped- Returns:
- a new list which contains all the items in
pathexcept for the first item
-
popBack
public static java.util.List<java.lang.String> popBack(java.util.List<java.lang.String> path)
Removes the last item from a path.- Parameters:
path- the path whose last item is being popped- Returns:
- a new list which contains all the items in
pathexcept for the last item
-
-