Package org.spdx.tools
Class CompareSpdxDocs
java.lang.Object
org.spdx.tools.CompareSpdxDocs
public class CompareSpdxDocs extends Object
Command line application to compare two SPDX documents
Usage: CompareSpdxDoc doc1 doc2 [output]
where doc1 and doc2 are two SPDX documents in either RDF/XML or tag/value format
and [output] is an optional SPDX document
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description CompareSpdxDocs() -
Method Summary
Modifier and Type Method Description protected static StringconvertDocName(String docPath)Converts a file path or URL to a shorter document nameprotected static SpdxDocumentconvertTagValueToRdf(File tagValueFile, List<String> warnings)Converts a tag/value file to an rdfFilestatic voidmain(String[] args)protected static SpdxDocumentopenRdfOrTagDoc(String spdxDocFileName, List<String> warnings)
-
Constructor Details
-
CompareSpdxDocs
public CompareSpdxDocs()
-
-
Method Details
-
main
- Parameters:
args- CompareFile1, CompareFile2, optional output file- Throws:
Exception
-
convertDocName
Converts a file path or URL to a shorter document name- Parameters:
docPath-- Returns:
-
openRdfOrTagDoc
protected static SpdxDocument openRdfOrTagDoc(String spdxDocFileName, List<String> warnings) throws SpdxCompareException- Parameters:
spdxDocFileName- File name of either an RDF or Tag formated SPDX file- Returns:
- Throws:
SpdxCompareException
-
convertTagValueToRdf
protected static SpdxDocument convertTagValueToRdf(File tagValueFile, List<String> warnings) throws SpdxCompareException, ExceptionConverts a tag/value file to an rdfFile- Parameters:
tagValueFile- Input file in tag/value formattempRdfFile- File to output the generated RDF file (must already exist - file is overwritten)- Throws:
SpdxCompareExceptionException
-