/** * Throws an exception if the given file does not exist */ public static void assertFileExists(File file) { assertExists(file); if (!file.isFile()) { throw new IllegalArgumentException(file + " is not a file!"); } }
/** * Throws an exception if the given file does not exist */ public static void assertDirectoryExists(File file) { assertExists(file); if (!file.isDirectory()) { throw new IllegalArgumentException(file + " is not a directory!"); } }