Package io.hawt.util
Class Files
java.lang.Object
io.hawt.util.Files
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertDirectoryExists(File file) Throws an exception if the given file does not existstatic voidassertExists(File file) Throws an exception if the given file or directory does not existstatic voidassertFileExists(File file) Throws an exception if the given file does not existstatic voidstatic StringgetMimeType(File file) static StringgetRelativePath(File rootDir, File file) static byte[]Reads aFileand returns the data as a byte arraystatic intrecursiveDelete(File file) Recursively deletes the given file whether it's a file or directory returning the number of files deleted
-
Constructor Details
-
Files
public Files()
-
-
Method Details
-
copy
- Throws:
IOException
-
recursiveDelete
Recursively deletes the given file whether it's a file or directory returning the number of files deleted -
getRelativePath
- Throws:
IOException
-
readBytes
Reads aFileand returns the data as a byte array- Throws:
IOException
-
getMimeType
-
assertExists
Throws an exception if the given file or directory does not exist -
assertFileExists
Throws an exception if the given file does not exist -
assertDirectoryExists
Throws an exception if the given file does not exist
-