public final class FileSystemUtils
extends java.lang.Object
Path
Modifier and Type | Method and Description |
---|---|
static java.nio.file.Path |
append(java.nio.file.Path base,
java.nio.file.Path path,
int strip)
Appends the path to the given base and strips N elements off the path if strip is > 0.
|
static void |
deleteSubDirectories(java.nio.file.Path... paths)
Deletes all subdirectories in the given path recursively
|
static boolean |
exists(java.nio.file.Path... files)
Returns
true iff one of the files exists otherwise false |
static java.nio.file.Path[] |
files(java.nio.file.Path directory)
Returns an array of all files in the given directory.
|
static java.nio.file.Path[] |
files(java.nio.file.Path from,
java.nio.file.DirectoryStream.Filter<java.nio.file.Path> filter)
Returns an array of all files in the given directory matching.
|
static java.nio.file.Path[] |
files(java.nio.file.Path directory,
java.lang.String glob)
Returns an array of all files in the given directory matching the glob.
|
static boolean |
isAccessibleDirectory(java.nio.file.Path directory,
org.apache.logging.log4j.Logger logger)
Check that a directory exists, is a directory and is readable
by the current user
|
static boolean |
isHidden(java.nio.file.Path path)
Check whether the file denoted by the given path is hidden.
|
static java.io.BufferedReader |
newBufferedReader(java.net.URL url,
java.nio.charset.Charset cs)
Opens the given url for reading returning a
BufferedReader that may be
used to read text from the URL in an efficient manner. |
public static boolean exists(java.nio.file.Path... files)
true
iff one of the files exists otherwise false
public static boolean isHidden(java.nio.file.Path path)
Files.isHidden(Path)
as this
does not depend on the operating system.public static java.nio.file.Path append(java.nio.file.Path base, java.nio.file.Path path, int strip)
public static void deleteSubDirectories(java.nio.file.Path... paths) throws java.io.IOException
java.lang.IllegalArgumentException
- if the given path is not a directoryjava.io.IOException
public static boolean isAccessibleDirectory(java.nio.file.Path directory, org.apache.logging.log4j.Logger logger)
public static java.io.BufferedReader newBufferedReader(java.net.URL url, java.nio.charset.Charset cs) throws java.io.IOException
BufferedReader
that may be
used to read text from the URL in an efficient manner. Bytes from the
file are decoded into characters using the specified charset.java.io.IOException
public static java.nio.file.Path[] files(java.nio.file.Path from, java.nio.file.DirectoryStream.Filter<java.nio.file.Path> filter) throws java.io.IOException
java.io.IOException
public static java.nio.file.Path[] files(java.nio.file.Path directory) throws java.io.IOException
java.io.IOException
public static java.nio.file.Path[] files(java.nio.file.Path directory, java.lang.String glob) throws java.io.IOException
java.io.IOException