Class PathUtil

java.lang.Object
com.apple.foundationdb.directory.PathUtil

public class PathUtil extends Object
The PathUtil class provides static helper functions useful for working with directory paths.
  • Method Details

    • join

      public static List<String> join(List<String> path1, List<String> path2)
      Joins two paths into one larger path.
      Parameters:
      path1 - The first path to join
      path2 - The path to append to path1
      Returns:
      a new list which contains all the items in path1 followed by all the items in path2
    • extend

      public static List<String> extend(List<String> path, String... subPaths)
      Extends a path by an arbitrary number of elements.
      Parameters:
      path - The path to extend
      subPaths - The items to append to path
      Returns:
      a new list which contains all the items in path followed by all additional items specified in subPaths
    • from

      public static List<String> from(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 List<String> popFront(List<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 path except for the first item
    • popBack

      public static List<String> popBack(List<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 path except for the last item