private static void verifyExisting(JApiCmpArchive jApiCmpArchive) { if (!jApiCmpArchive.getFile().exists()) { throw JApiCmpException.cliError("File '%s' does not exist.", jApiCmpArchive.getFile().getAbsolutePath()); } }
private static void verifyCanRead(JApiCmpArchive jApiCmpArchive) { if (!jApiCmpArchive.getFile().canRead()) { throw JApiCmpException.cliError("Cannot read file '%s'.", jApiCmpArchive.getFile().getAbsolutePath()); } }
private static void verifyJarArchive(JApiCmpArchive jApiCmpArchive) { JarFile jarFile = null; try { jarFile = new JarFile(jApiCmpArchive.getFile()); } catch (IOException e) { throw JApiCmpException.cliError("File '%s' could not be opened as a jar file: %s", jApiCmpArchive.getFile().getAbsolutePath(), e.getMessage(), e); } finally { if (jarFile != null) { try { jarFile.close(); } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to close file: " + e.getLocalizedMessage(), e); } } } }
private static void verifyCanRead(JApiCmpArchive jApiCmpArchive) { if (!jApiCmpArchive.getFile().canRead()) { throw JApiCmpException.cliError("Cannot read file '%s'.", jApiCmpArchive.getFile().getAbsolutePath()); } }
private static void verifyJarArchive(JApiCmpArchive jApiCmpArchive) { JarFile jarFile = null; try { jarFile = new JarFile(jApiCmpArchive.getFile()); } catch (IOException e) { throw JApiCmpException.cliError("File '%s' could not be opened as a jar file: %s", jApiCmpArchive.getFile().getAbsolutePath(), e.getMessage(), e); } finally { if (jarFile != null) { try { jarFile.close(); } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to close file: " + e.getLocalizedMessage(), e); } } } }
private static void verifyExisting(JApiCmpArchive jApiCmpArchive) { if (!jApiCmpArchive.getFile().exists()) { throw JApiCmpException.cliError("File '%s' does not exist.", jApiCmpArchive.getFile().getAbsolutePath()); } }
File stylesheetFile = new File(pathname); if (!stylesheetFile.exists()) { throw JApiCmpException.cliError("HTML stylesheet '%s' does not exist.", pathname); throw JApiCmpException.cliError("Define a HTML output file, if you want to apply a stylesheet."); } else { if (getOldClassPath().isPresent() || getNewClassPath().isPresent()) { throw JApiCmpException.cliError("Please provide both options: " + CliParser.OLD_CLASSPATH + " and " + CliParser.NEW_CLASSPATH); } else { setClassPathMode(JApiCli.ClassPathMode.ONE_COMMON_CLASSPATH);
File stylesheetFile = new File(pathname); if (!stylesheetFile.exists()) { throw JApiCmpException.cliError("HTML stylesheet '%s' does not exist.", pathname); throw JApiCmpException.cliError("Define a HTML output file, if you want to apply a stylesheet."); } else { if (getOldClassPath().isPresent() || getNewClassPath().isPresent()) { throw JApiCmpException.cliError("Please provide both options: " + CliParser.OLD_CLASSPATH + " and " + CliParser.NEW_CLASSPATH); } else { setClassPathMode(JApiCli.ClassPathMode.ONE_COMMON_CLASSPATH);