Package org.spdx.utility.compare
Class SpdxFileComparer
java.lang.Object
org.spdx.utility.compare.SpdxItemComparer
org.spdx.utility.compare.SpdxFileComparer
Compares two SPDX files. The
compare(fileA, fileB) method will perform the comparison and
store the results. isDifferenceFound() will return true of any
differences were found.- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.utility.compare.SpdxItemComparer
documentItem, extractedLicenseIdMap, name -
Constructor Summary
ConstructorsConstructorDescriptionSpdxFileComparer(Map<SpdxDocument, Map<SpdxDocument, Map<String, String>>> extractedLicenseIdMap) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocumentFile(SpdxDocument spdxDocument, SpdxFile spdxFile) Add a file to the comparer and compare to the existing filesprotected voidchecks to make sure there is not a compare in progressgetFile(SpdxDocument spdxDocument) getFileDifference(SpdxDocument docA, SpdxDocument docB) Return a file difference for the file contained in two different documentsgetUniqueChecksums(SpdxDocument docA, SpdxDocument docB) Get the checksums which are present in the file contained document A but not in document BbooleanbooleanbooleanbooleanbooleanMethods inherited from class org.spdx.utility.compare.SpdxItemComparer
addDocumentItem, checkCompareMade, getItem, getUniqueAnnotations, getUniqueRelationship, getUniqueSeenLicenses, isAnnotationsEquals, isAttributionTextEquals, isCommentsEquals, isConcludedLicenseEquals, isCopyrightsEquals, isInProgress, isLicenseCommmentsEquals, isRelationshipsEquals, isSeenLicenseEquals
-
Constructor Details
-
SpdxFileComparer
public SpdxFileComparer(Map<SpdxDocument, Map<SpdxDocument, Map<String, String>>> extractedLicenseIdMap)
-
-
Method Details
-
addDocumentFile
public void addDocumentFile(SpdxDocument spdxDocument, SpdxFile spdxFile) throws SpdxCompareException, InvalidSPDXAnalysisException Add a file to the comparer and compare to the existing files- Parameters:
spdxDocument- document containing the filespdxFile-- Throws:
SpdxCompareExceptionInvalidSPDXAnalysisException
-
getFile
- Throws:
SpdxCompareException
-
isChecksumsEquals
- Returns:
- the checksumsEquals
- Throws:
SpdxCompareException
-
getUniqueChecksums
public List<Checksum> getUniqueChecksums(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException Get the checksums which are present in the file contained document A but not in document B- Parameters:
docA-docB-- Returns:
- Throws:
SpdxCompareException
-
isTypesEquals
- Returns:
- the typesEquals
- Throws:
SpdxCompareException
-
checkInProgress
checks to make sure there is not a compare in progress- Overrides:
checkInProgressin classSpdxItemComparer- Throws:
SpdxCompareException
-
isContributorsEquals
- Returns:
- the contributorsEquals
- Throws:
SpdxCompareException
-
isNoticeTextEquals
- Returns:
- the noticeTextEquals
- Throws:
SpdxCompareException
-
isDifferenceFound
- Overrides:
isDifferenceFoundin classSpdxItemComparer- Returns:
- Throws:
SpdxCompareException
-
getFileDifference
public SpdxFileDifference getFileDifference(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException Return a file difference for the file contained in two different documents- Parameters:
docA-docB-- Returns:
- Throws:
SpdxCompareException
-