Class PathUtils

java.lang.Object
io.redlink.utils.PathUtils

public final class PathUtils extends Object
Various Utils for Paths.
  • Method Details

    • copy

      public static void copy(Path source, Path dest) throws IOException
      Copy a file/directory.
      Parameters:
      source - the source
      dest - the destination
      Throws:
      IOException
    • copy

      public static void copy(Path source, Path dest, boolean preserve) throws IOException
      Copy a file/directory
      Parameters:
      source - the source
      dest - the destination
      preserve - preserve attributes
      Throws:
      IOException
    • copyRecursive

      public static void copyRecursive(Path source, Path dest) throws IOException
      Recursively copy a directory
      Parameters:
      source - the source
      dest - the destination
      Throws:
      IOException
    • copyRecursive

      public static void copyRecursive(Path source, Path dest, boolean preserve) throws IOException
      Recursively copy a directory
      Parameters:
      source - the source
      dest - the destination
      preserve - preserve attributes
      Throws:
      IOException
    • deleteRecursive

      public static void deleteRecursive(Path path) throws IOException
      Recursively delete a file/directory
      Parameters:
      path - the file/directory to delete
      Throws:
      IOException
    • deleteRecursive

      public static void deleteRecursive(Path path, boolean followSymlinks) throws IOException
      Recursively delete a file/directory
      Parameters:
      path - the file/directory to delete
      followSymlinks - whether to follow symlinks while deleting
      Throws:
      IOException