Class Paths


  • public class Paths
    extends java.lang.Object
    Collection of Path-related utility methods.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  Paths.DeletionVisitor  
    • Constructor Summary

      Constructors 
      Constructor Description
      Paths()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void delete​(java.nio.file.Path path)
      Delete the given Path whether it is a directory or a simple file.
      static void deleteQuietly​(java.nio.file.Path path)
      Delete the given Path without throwing any Exception if any occurs during the deletion.
      private static void doDelete​(java.nio.file.Path path, boolean quiet)  
      static java.nio.file.Path getParent​(java.nio.file.Path path)  
      • Methods inherited from class java.lang.Object

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

      • Paths

        public Paths()
    • Method Detail

      • deleteQuietly

        public static void deleteQuietly​(java.nio.file.Path path)
        Delete the given Path without throwing any Exception if any occurs during the deletion. If the path is a directory, it will be deleted recursively.
        Parameters:
        path - the path to delete
      • delete

        public static void delete​(java.nio.file.Path path)
                           throws java.io.IOException
        Delete the given Path whether it is a directory or a simple file. If the path is a directory, it will be deleted recursively.
        Parameters:
        path - the path to delete
        Throws:
        java.io.IOException
      • doDelete

        private static void doDelete​(java.nio.file.Path path,
                                     boolean quiet)
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • getParent

        public static java.nio.file.Path getParent​(java.nio.file.Path path)