Class FilePathTools

java.lang.Object
dev.buildtool.tools.FilePathTools

public class FilePathTools
extends java.lang.Object
  • Constructor Summary

    Constructors 
    Constructor Description
    FilePathTools()  
  • Method Summary

    Modifier and Type Method Description
    static java.nio.file.Path copyFile​(java.nio.file.Path from, java.nio.file.Path to, java.nio.file.CopyOption... copyOptions)
    Copies the file, creating parent directories in the process
    static java.nio.file.Path createFile​(java.nio.file.Path path, java.nio.file.LinkOption... linkOptions)  
    static boolean delete​(java.nio.file.Path path)
    Recursively deletes files and folders
    static java.util.List<java.nio.file.Path> getDirectories​(java.nio.file.Path from, java.util.List<java.nio.file.Path> list)
    Recursively gets all directories
    static java.util.List<java.nio.file.Path> getFiles​(java.nio.file.Path from, java.util.List<java.nio.file.Path> list)
    Recursively retrieves all files from the specified path
    static java.util.List<java.lang.String> readFile​(java.nio.file.Path path)  
    static java.nio.file.Path write​(java.nio.file.Path path, java.lang.Iterable<? extends java.lang.CharSequence> charSequences)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • createFile

      public static java.nio.file.Path createFile​(java.nio.file.Path path, java.nio.file.LinkOption... linkOptions)
    • copyFile

      public static java.nio.file.Path copyFile​(java.nio.file.Path from, java.nio.file.Path to, java.nio.file.CopyOption... copyOptions)
      Copies the file, creating parent directories in the process
    • readFile

      public static java.util.List<java.lang.String> readFile​(java.nio.file.Path path)
    • write

      public static java.nio.file.Path write​(java.nio.file.Path path, java.lang.Iterable<? extends java.lang.CharSequence> charSequences)
    • delete

      public static boolean delete​(java.nio.file.Path path)
      Recursively deletes files and folders
      Parameters:
      path - file or dir
      Returns:
      true on success
    • getFiles

      public static java.util.List<java.nio.file.Path> getFiles​(java.nio.file.Path from, java.util.List<java.nio.file.Path> list)
      Recursively retrieves all files from the specified path
      Parameters:
      from - a directory
      list - list to populate with files
      Returns:
      file list
    • getDirectories

      public static java.util.List<java.nio.file.Path> getDirectories​(java.nio.file.Path from, java.util.List<java.nio.file.Path> list)
      Recursively gets all directories