Class FileUtils


  • public final class FileUtils
    extends Object
    File I/O utilities.
    • Method Detail

      • readFile

        public static byte[] readFile​(String fileName)
        Reads the named file, translating IOException to a RuntimeException of some sort.
        Parameters:
        fileName - non-null; name of the file to read
        Returns:
        non-null; contents of the file
      • readFile

        public static byte[] readFile​(File file)
        Reads the given file, translating IOException to a RuntimeException of some sort.
        Parameters:
        file - non-null; the file to read
        Returns:
        non-null; contents of the file
      • hasArchiveSuffix

        public static boolean hasArchiveSuffix​(String fileName)
        Returns true if fileName names a .zip, .jar, or .apk.