Package de.xima.fc.utils
Class XNioPathUtils
- java.lang.Object
-
- de.xima.fc.utils.XNioPathUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
deleteQuietly(Path path)
Deletes the file at the given path, ignoring any exceptions that may occur.static String
getFileName(Path path)
Gets the file name of the given path, or empty when the path does not have any path segments.static byte[]
readFileToByteArray(Path path)
Reads the contents of the file at the given path into a byte array.
-
-
-
Method Detail
-
deleteQuietly
public static void deleteQuietly(Path path)
Deletes the file at the given path, ignoring any exceptions that may occur.- Parameters:
path
- Path to delete.
-
getFileName
public static String getFileName(Path path)
Gets the file name of the given path, or empty when the path does not have any path segments.- Parameters:
path
- Path to process.- Returns:
- The file name of the given path.
-
readFileToByteArray
public static byte[] readFileToByteArray(Path path) throws IOException
Reads the contents of the file at the given path into a byte array.- Parameters:
path
- Path to read.- Returns:
- The contents of the file at the given path as a byte array.
- Throws:
IOException
-
-