Package jodd.io

Class PathUtil


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

      Constructors 
      Constructor Description
      PathUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deleteFileTree​(java.nio.file.Path directory)
      Deletes a directory recursively.
      static java.lang.String readString​(java.nio.file.Path path)
      Reads path content.
      static java.nio.file.Path resolve​(java.nio.file.Path base, java.lang.String child)
      Resolves subpath in safer way.
      static java.nio.file.Path resolve​(java.nio.file.Path path, java.lang.String... childs)  
      • Methods inherited from class java.lang.Object

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

      • PathUtil

        public PathUtil()
    • Method Detail

      • resolve

        public static java.nio.file.Path resolve​(java.nio.file.Path base,
                                                 java.lang.String child)
        Resolves subpath in safer way. For some reason, if child starts with a separator it gets resolved as a full path, ignoring the base. This method acts different.
      • resolve

        public static java.nio.file.Path resolve​(java.nio.file.Path path,
                                                 java.lang.String... childs)
      • readString

        public static java.lang.String readString​(java.nio.file.Path path)
                                           throws java.io.IOException
        Reads path content.
        Throws:
        java.io.IOException
      • deleteFileTree

        public static void deleteFileTree​(java.nio.file.Path directory)
                                   throws java.io.IOException
        Deletes a directory recursively.
        Throws:
        java.io.IOException