public class ValidateLauncher extends Object
Constructor and Description |
---|
ValidateLauncher()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
displayHelp()
Displays tool usage.
|
void |
displayVersion()
Displays the current version and disclaimer notice.
|
boolean |
doValidation(Map<URL,String> checksumManifest)
Performs validation.
|
void |
flushValidators()
Flush ValidatorFactory cache (set to null).
|
String |
getLabelExtension() |
File |
getNonRegisteredProductsFile() |
File |
getRegisteredProductsFile() |
Report |
getReport()
Gets the object representation of the Validation Report.
|
static void |
main(String[] args)
Main class that launches the Validate Tool.
|
org.apache.commons.cli.CommandLine |
parse(String[] args)
Parse the command-line arguments
|
void |
printReportFooter()
Print the report footer.
|
int |
processMain(String[] args)
Wrapper method for the main class that returns valid exitCode for execution.
|
void |
query(org.apache.commons.cli.CommandLine line)
Query the command-line and process the command-line option flags set.
|
void |
query(File configuration)
Query the configuration file.
|
void |
setAdditionalPaths(List<String> additionalPaths)
Set additional paths to be specified when attempting referential integrity validation
(pds4.bundle or pds4.collection rules)
|
void |
setAllowUnlabeledFiles(boolean flag) |
void |
setCatalogs(List<String> catalogs)
Set the catalogs.
|
void |
setCheckInbetweenFields(boolean flag) |
void |
setChecksumManifest(String manifest)
Set the checksum manifest.
|
void |
setContentValidation(boolean flag)
Sets the flag that enables/disables data content validation.
|
void |
setContextReferenceCheck(boolean flag) |
void |
setForce(boolean value) |
void |
setLabelExtension(String labelExtension)
Set the label extension to crawl for within the target space.
|
void |
setManifestBasePath(String path)
Set the base path to look up relative file references in a given checksum manifest file.
|
void |
setMaxErrors(long value) |
void |
setNonRegisteredProducts(boolean nonRegisteredProducts) |
void |
setNonRegisteredProductsFile(File nonRegisteredProductsFile) |
void |
setRegExps(List<String> patterns)
Sets the list of file patterns to look for if traversing a directory.
|
void |
setRegisteredProductsFile(File registeredProductsFile) |
void |
setReport(File report)
Sets the report file.
|
void |
setReportStyle(String style)
Set the output style for the report.
|
void |
setSchemas(List<String> schemas)
Set the schemas.
|
void |
setSchematrons(List<String> schematrons)
Set the schematrons.
|
void |
setSeverity(int level)
Sets the severity level for the report.
|
void |
setSkipProductValidation(boolean flag) |
void |
setSpotCheckData(int value) |
void |
setTargets(List<String> targets)
Set the target.
|
void |
setTraverse(boolean value)
Sets the flag to enable/disable directory recursion.
|
void |
setUpdateRegisteredProducts(boolean updateRegisteredProducts) |
void |
setupReport()
Setup the report.
|
void |
setValidateContext(boolean flag)
Sets the flag that enables/disables context validation.
|
void |
setValidationRule(String value)
Sets the validation rule name to use.
|
public ValidateLauncher() throws TransformerConfigurationException
public org.apache.commons.cli.CommandLine parse(String[] args) throws org.apache.commons.cli.ParseException
args
- The command-line argumentsorg.apache.commons.cli.ParseException
- If an error occurred during parsing.public void query(org.apache.commons.cli.CommandLine line) throws Exception
line
- A CommandLine object containing the flags that were set.Exception
- If an error occurred while processing the command-line options.public void query(File configuration) throws org.apache.commons.configuration.ConfigurationException
configuration
- A configuration file.org.apache.commons.configuration.ConfigurationException
- If an error occurred while querying the configuration file.public void setAdditionalPaths(List<String> additionalPaths) throws MalformedURLException
additionalPaths
- A list of paths.MalformedURLException
public void setTargets(List<String> targets) throws MalformedURLException
targets
- A list of targets.MalformedURLException
public void setChecksumManifest(String manifest) throws MalformedURLException
manifest
- A checksum manifest file.MalformedURLException
public void setManifestBasePath(String path) throws MalformedURLException
path
- A path.MalformedURLException
public void setSchemas(List<String> schemas) throws MalformedURLException
schemas
- A list of schemas.MalformedURLException
public void setSchematrons(List<String> schematrons) throws MalformedURLException
schematrons
- A list of schematrons.MalformedURLException
public void setCatalogs(List<String> catalogs)
catalogs
- A list of catalogs.public void setReport(File report)
report
- A report file.public Report getReport()
public void setReportStyle(String style) throws Exception
style
- 'sum' for a summary report, 'min' for a minimal report, and 'full' for a full
reportException
public void setTraverse(boolean value)
value
- A boolean value.public void setSeverity(int level)
level
- An interger value.public void setRegExps(List<String> patterns)
patterns
- A list of file patterns.public void setForce(boolean value)
public void setValidationRule(String value)
value
- the validation rule namepublic void setContentValidation(boolean flag)
flag
- True or False.public void setContextReferenceCheck(boolean flag)
public void setCheckInbetweenFields(boolean flag)
public void setSkipProductValidation(boolean flag)
public void setMaxErrors(long value)
public void setSpotCheckData(int value)
public void setAllowUnlabeledFiles(boolean flag)
public void setUpdateRegisteredProducts(boolean updateRegisteredProducts)
public void setNonRegisteredProducts(boolean nonRegisteredProducts)
public File getRegisteredProductsFile()
public void setRegisteredProductsFile(File registeredProductsFile)
public File getNonRegisteredProductsFile()
public void setNonRegisteredProductsFile(File nonRegisteredProductsFile)
public void setValidateContext(boolean flag)
flag
- True or False.public void displayHelp()
public void displayVersion() throws IOException
IOException
- If there was an error that occurred while getting the tool information.public void setupReport() throws IOException
IOException
- If an error occurred while setting up the report.public boolean doValidation(Map<URL,String> checksumManifest) throws Exception
checksumManifest
- Exception
public void printReportFooter()
public int processMain(String[] args) throws Exception
args
- list of command-line arguments.Exception
public void flushValidators()
public static void main(String[] args) throws TransformerConfigurationException
args
- A list of command-line arguments.TransformerConfigurationException
public String getLabelExtension()
public void setLabelExtension(String labelExtension)
labelExtension
- Copyright © 2023 Jet Propulsion Laboratory, California Institute of Technology. All rights reserved.