private void validateArgs() throws FileNotFoundException, ParseException {
        if (isUpdateOnly() || isRunScan()) {
            final String value = line.getOptionValue(ARGUMENT.CVE_VALID_FOR_HOURS);
            if (value != null) {
                try {
                    final int i = Integer.parseInt(value);
                    if (i < 0) {
                        throw new ParseException("Invalid Setting: cveValidForHours must be a number greater than or equal to 0.");
                    }
                } catch (NumberFormatException ex) {
                    throw new ParseException("Invalid Setting: cveValidForHours must be a number greater than or equal to 0.");
                }
            }
        }
        if (isRunScan()) {
            validatePathExists(getScanFiles(), ARGUMENT.SCAN);
            validatePathExists(getReportDirectory(), ARGUMENT.OUT);
            if (getPathToCore() != null) {
                validatePathExists(getPathToCore(), ARGUMENT.PATH_TO_CORE);
            }
            if (line.hasOption(ARGUMENT.OUTPUT_FORMAT)) {
                final String format = line.getOptionValue(ARGUMENT.OUTPUT_FORMAT);
                try {
                    Format.valueOf(format);
                } catch (IllegalArgumentException ex) {
                    final String msg = String.format("An invalid 'format' of '%s' was specified. "
                            + "Supported output formats are " + SUPPORTED_FORMATS, format);
                    throw new ParseException(msg);
                }
            }
            if ((getBaseCveUrl() != null && getModifiedCveUrl() == null) || (getBaseCveUrl() == null && getModifiedCveUrl() != null)) {
                final String msg = "If one of the CVE URLs is specified they must all be specified; please add the missing CVE URL.";
                throw new ParseException(msg);
            }
            if (line.hasOption(ARGUMENT.SYM_LINK_DEPTH)) {
                try {
                    final int i = Integer.parseInt(line.getOptionValue(ARGUMENT.SYM_LINK_DEPTH));
                    if (i < 0) {
                        throw new ParseException("Symbolic Link Depth (symLink) must be greater than zero.");
                    }
                } catch (NumberFormatException ex) {
                    throw new ParseException("Symbolic Link Depth (symLink) is not a number.");
                }
            }
        }
    }
private void validateArgs ( ) throws FileNotFoundException , ParseException { if ( isUpdateOnly ( ) || isRunScan ( ) ) { final String value = line . getOptionValue ( ARGUMENT . CVE_VALID_FOR_HOURS ) ; if ( value != null ) { try { final int i = Integer . parseInt ( value ) ; if ( i < 0 ) { throw new ParseException ( "Invalid Setting: cveValidForHours must be a number greater than or equal to 0." ) ; } } catch ( NumberFormatException ex ) { throw new ParseException ( "Invalid Setting: cveValidForHours must be a number greater than or equal to 0." ) ; } } } if ( isRunScan ( ) ) { validatePathExists ( getScanFiles ( ) , ARGUMENT . SCAN ) ; validatePathExists ( getReportDirectory ( ) , ARGUMENT . OUT ) ; if ( getPathToCore ( ) != null ) { validatePathExists ( getPathToCore ( ) , ARGUMENT . PATH_TO_CORE ) ; } if ( line . hasOption ( ARGUMENT . OUTPUT_FORMAT ) ) { final String format = line . getOptionValue ( ARGUMENT . OUTPUT_FORMAT ) ; try { Format . valueOf ( format ) ; } catch ( IllegalArgumentException ex ) { final String msg = String . format ( "An invalid 'format' of '%s' was specified. " + "Supported output formats are " + SUPPORTED_FORMATS , format ) ; throw new ParseException ( msg ) ; } } if ( ( getBaseCveUrl ( ) != null && getModifiedCveUrl ( ) == null ) || ( getBaseCveUrl ( ) == null && getModifiedCveUrl ( ) != null ) ) { final String msg = "If one of the CVE URLs is specified they must all be specified; please add the missing CVE URL." ; throw new ParseException ( msg ) ; } if ( line . hasOption ( ARGUMENT . SYM_LINK_DEPTH ) ) { try { final int i = Integer . parseInt ( line . getOptionValue ( ARGUMENT . SYM_LINK_DEPTH ) ) ; if ( i < 0 ) { throw new ParseException ( "Symbolic Link Depth (symLink) must be greater than zero." ) ; } } catch ( NumberFormatException ex ) { throw new ParseException ( "Symbolic Link Depth (symLink) is not a number." ) ; } } } }
Validates that the command line arguments are valid.

@throws FileNotFoundException if there is a file specified by either the
SCAN or CPE command line arguments that does not exist.
@throws ParseException is thrown if there is an exception parsing the
command line.