Package io.hawt.util

Class Files

java.lang.Object
io.hawt.util.Files

public class Files extends Object
  • Constructor Details

    • Files

      public Files()
  • Method Details

    • copy

      public static void copy(File source, File target) throws IOException
      Copy the source File to the target File.
      Throws:
      IOException
    • recursiveDelete

      public static int recursiveDelete(File file)
      Recursively deletes the given file whether it's a file or directory returning the number of files deleted
    • getRelativePath

      public static String getRelativePath(File rootDir, File file) throws IOException
      Throws:
      IOException
    • readBytes

      public static byte[] readBytes(File file) throws IOException
      Reads a File and returns the data as a byte array
      Throws:
      IOException
    • getMimeType

      public static String getMimeType(File file)
    • assertExists

      public static void assertExists(File file)
      Throws an exception if the given file or directory does not exist
    • assertFileExists

      public static void assertFileExists(File file)
      Throws an exception if the given file does not exist
    • assertDirectoryExists

      public static void assertDirectoryExists(File file)
      Throws an exception if the given file does not exist