Class XNioPathUtils
java.lang.Object
de.xima.fc.utils.XNioPathUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeleteQuietly(Path path) Deletes the file at the given path, ignoring any exceptions that may occur.static longfileSizeOrZero(Path path) Gets the size of the given file.static StringgetFileName(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 Details
-
deleteQuietly
Deletes the file at the given path, ignoring any exceptions that may occur.- Parameters:
path- Path to delete.
-
fileSizeOrZero
Gets the size of the given file. When not a regular file or the file does not exist, 0 is returned.- Parameters:
path- Path to the file.- Returns:
- The size of the given file.
-
getFileName
-
readFileToByteArray
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
-