Package jodd.io
Class PathUtil
- java.lang.Object
-
- jodd.io.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 voiddeleteFileTree(java.nio.file.Path directory)Deletes a directory recursively.static java.lang.StringreadString(java.nio.file.Path path)Reads path content.static java.nio.file.Pathresolve(java.nio.file.Path base, java.lang.String child)Resolves subpath in safer way.static java.nio.file.Pathresolve(java.nio.file.Path path, java.lang.String... childs)
-
-
-
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.IOExceptionReads path content.- Throws:
java.io.IOException
-
deleteFileTree
public static void deleteFileTree(java.nio.file.Path directory) throws java.io.IOExceptionDeletes a directory recursively.- Throws:
java.io.IOException
-
-