|
36 | 36 | import org.spdx.library.ListedLicenses; |
37 | 37 | import org.spdx.library.model.v2.SpdxConstantsCompatV2; |
38 | 38 | import org.spdx.library.model.v2.SpdxCreatorInformation; |
39 | | -import org.spdx.library.model.v3_0_0.ModelObjectV3; |
40 | | -import org.spdx.library.model.v3_0_0.SpdxConstantsV3; |
41 | | -import org.spdx.library.model.v3_0_0.SpdxModelClassFactoryV3; |
42 | | -import org.spdx.library.model.v3_0_0.core.Agent; |
43 | | -import org.spdx.library.model.v3_0_0.core.Annotation; |
44 | | -import org.spdx.library.model.v3_0_0.core.AnnotationType; |
45 | | -import org.spdx.library.model.v3_0_0.core.CreationInfo; |
46 | | -import org.spdx.library.model.v3_0_0.core.Element; |
47 | | -import org.spdx.library.model.v3_0_0.core.ExternalElement; |
48 | | -import org.spdx.library.model.v3_0_0.core.ExternalIdentifierType; |
49 | | -import org.spdx.library.model.v3_0_0.core.ExternalMap; |
50 | | -import org.spdx.library.model.v3_0_0.core.ExternalRefType; |
51 | | -import org.spdx.library.model.v3_0_0.core.Hash; |
52 | | -import org.spdx.library.model.v3_0_0.core.HashAlgorithm; |
53 | | -import org.spdx.library.model.v3_0_0.core.IntegrityMethod; |
54 | | -import org.spdx.library.model.v3_0_0.core.LifecycleScopeType; |
55 | | -import org.spdx.library.model.v3_0_0.core.LifecycleScopedRelationship; |
56 | | -import org.spdx.library.model.v3_0_0.core.NamespaceMap; |
57 | | -import org.spdx.library.model.v3_0_0.core.NoAssertionElement; |
58 | | -import org.spdx.library.model.v3_0_0.core.NoneElement; |
59 | | -import org.spdx.library.model.v3_0_0.core.Organization; |
60 | | -import org.spdx.library.model.v3_0_0.core.PackageVerificationCode; |
61 | | -import org.spdx.library.model.v3_0_0.core.Person; |
62 | | -import org.spdx.library.model.v3_0_0.core.Relationship; |
63 | | -import org.spdx.library.model.v3_0_0.core.RelationshipCompleteness; |
64 | | -import org.spdx.library.model.v3_0_0.core.RelationshipType; |
65 | | -import org.spdx.library.model.v3_0_0.core.SpdxDocument; |
66 | | -import org.spdx.library.model.v3_0_0.core.Tool; |
67 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.ConjunctiveLicenseSet; |
68 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.CustomLicense; |
69 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.CustomLicenseAddition; |
70 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.DisjunctiveLicenseSet; |
71 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.ExtendableLicense; |
72 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.ExternalCustomLicense; |
73 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.License; |
74 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.LicenseAddition; |
75 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.ListedLicense; |
76 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.ListedLicenseException; |
77 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.NoAssertionLicense; |
78 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.NoneLicense; |
79 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.OrLaterOperator; |
80 | | -import org.spdx.library.model.v3_0_0.expandedlicensing.WithAdditionOperator; |
81 | | -import org.spdx.library.model.v3_0_0.simplelicensing.AnyLicenseInfo; |
82 | | -import org.spdx.library.model.v3_0_0.software.ContentIdentifierType; |
83 | | -import org.spdx.library.model.v3_0_0.software.Snippet; |
84 | | -import org.spdx.library.model.v3_0_0.software.SoftwareArtifact; |
85 | | -import org.spdx.library.model.v3_0_0.software.SoftwarePurpose; |
86 | | -import org.spdx.library.model.v3_0_0.software.SpdxFile; |
87 | | -import org.spdx.library.model.v3_0_0.software.SpdxPackage; |
| 39 | +import org.spdx.library.model.v3_0_1.ModelObjectV3; |
| 40 | +import org.spdx.library.model.v3_0_1.SpdxConstantsV3; |
| 41 | +import org.spdx.library.model.v3_0_1.SpdxModelClassFactoryV3; |
| 42 | +import org.spdx.library.model.v3_0_1.core.Agent; |
| 43 | +import org.spdx.library.model.v3_0_1.core.Annotation; |
| 44 | +import org.spdx.library.model.v3_0_1.core.AnnotationType; |
| 45 | +import org.spdx.library.model.v3_0_1.core.CreationInfo; |
| 46 | +import org.spdx.library.model.v3_0_1.core.Element; |
| 47 | +import org.spdx.library.model.v3_0_1.core.ExternalElement; |
| 48 | +import org.spdx.library.model.v3_0_1.core.ExternalIdentifierType; |
| 49 | +import org.spdx.library.model.v3_0_1.core.ExternalMap; |
| 50 | +import org.spdx.library.model.v3_0_1.core.ExternalRefType; |
| 51 | +import org.spdx.library.model.v3_0_1.core.Hash; |
| 52 | +import org.spdx.library.model.v3_0_1.core.HashAlgorithm; |
| 53 | +import org.spdx.library.model.v3_0_1.core.IntegrityMethod; |
| 54 | +import org.spdx.library.model.v3_0_1.core.LifecycleScopeType; |
| 55 | +import org.spdx.library.model.v3_0_1.core.LifecycleScopedRelationship; |
| 56 | +import org.spdx.library.model.v3_0_1.core.NamespaceMap; |
| 57 | +import org.spdx.library.model.v3_0_1.core.NoAssertionElement; |
| 58 | +import org.spdx.library.model.v3_0_1.core.NoneElement; |
| 59 | +import org.spdx.library.model.v3_0_1.core.Organization; |
| 60 | +import org.spdx.library.model.v3_0_1.core.PackageVerificationCode; |
| 61 | +import org.spdx.library.model.v3_0_1.core.Person; |
| 62 | +import org.spdx.library.model.v3_0_1.core.Relationship; |
| 63 | +import org.spdx.library.model.v3_0_1.core.RelationshipCompleteness; |
| 64 | +import org.spdx.library.model.v3_0_1.core.RelationshipType; |
| 65 | +import org.spdx.library.model.v3_0_1.core.SpdxDocument; |
| 66 | +import org.spdx.library.model.v3_0_1.core.Tool; |
| 67 | +import org.spdx.library.model.v3_0_1.expandedlicensing.ConjunctiveLicenseSet; |
| 68 | +import org.spdx.library.model.v3_0_1.expandedlicensing.CustomLicense; |
| 69 | +import org.spdx.library.model.v3_0_1.expandedlicensing.CustomLicenseAddition; |
| 70 | +import org.spdx.library.model.v3_0_1.expandedlicensing.DisjunctiveLicenseSet; |
| 71 | +import org.spdx.library.model.v3_0_1.expandedlicensing.ExtendableLicense; |
| 72 | +import org.spdx.library.model.v3_0_1.expandedlicensing.ExternalCustomLicense; |
| 73 | +import org.spdx.library.model.v3_0_1.expandedlicensing.License; |
| 74 | +import org.spdx.library.model.v3_0_1.expandedlicensing.LicenseAddition; |
| 75 | +import org.spdx.library.model.v3_0_1.expandedlicensing.ListedLicense; |
| 76 | +import org.spdx.library.model.v3_0_1.expandedlicensing.ListedLicenseException; |
| 77 | +import org.spdx.library.model.v3_0_1.expandedlicensing.NoAssertionLicense; |
| 78 | +import org.spdx.library.model.v3_0_1.expandedlicensing.NoneLicense; |
| 79 | +import org.spdx.library.model.v3_0_1.expandedlicensing.OrLaterOperator; |
| 80 | +import org.spdx.library.model.v3_0_1.expandedlicensing.WithAdditionOperator; |
| 81 | +import org.spdx.library.model.v3_0_1.simplelicensing.AnyLicenseInfo; |
| 82 | +import org.spdx.library.model.v3_0_1.software.ContentIdentifierType; |
| 83 | +import org.spdx.library.model.v3_0_1.software.Snippet; |
| 84 | +import org.spdx.library.model.v3_0_1.software.SoftwareArtifact; |
| 85 | +import org.spdx.library.model.v3_0_1.software.SoftwarePurpose; |
| 86 | +import org.spdx.library.model.v3_0_1.software.SpdxFile; |
| 87 | +import org.spdx.library.model.v3_0_1.software.SpdxPackage; |
88 | 88 | import org.spdx.storage.IModelStore; |
89 | 89 | import org.spdx.storage.IModelStore.IdType; |
90 | 90 | import org.spdx.storage.listedlicense.SpdxListedLicenseModelStore; |
@@ -172,9 +172,9 @@ public class Spdx2to3Converter implements ISpdxConverter { |
172 | 172 | relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.STATIC_LINK, RelationshipType.HAS_STATIC_LINK); |
173 | 173 | relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.TEST_CASE_OF, RelationshipType.HAS_TEST_CASE); |
174 | 174 | swapToFromRelTypes.add(org.spdx.library.model.v2.enumerations.RelationshipType.TEST_CASE_OF); |
175 | | - relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.PREREQUISITE_FOR, RelationshipType.HAS_PREREQUSITE); |
| 175 | + relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.PREREQUISITE_FOR, RelationshipType.HAS_PREREQUISITE); |
176 | 176 | swapToFromRelTypes.add(org.spdx.library.model.v2.enumerations.RelationshipType.PREREQUISITE_FOR); |
177 | | - relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.HAS_PREREQUISITE, RelationshipType.HAS_PREREQUSITE); |
| 177 | + relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.HAS_PREREQUISITE, RelationshipType.HAS_PREREQUISITE); |
178 | 178 | relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.VARIANT_OF, RelationshipType.HAS_VARIANT); |
179 | 179 | swapToFromRelTypes.add(org.spdx.library.model.v2.enumerations.RelationshipType.VARIANT_OF); |
180 | 180 | relationshipTypeMap.put(org.spdx.library.model.v2.enumerations.RelationshipType.BUILD_DEPENDENCY_OF, RelationshipType.DEPENDS_ON); |
@@ -582,7 +582,7 @@ public SpdxDocument convertAndStore(org.spdx.library.model.v2.SpdxDocument fromD |
582 | 582 | toObjectUri, SpdxConstantsV3.CORE_SPDX_DOCUMENT, copyManager, true, defaultUriPrefix); |
583 | 583 | // NOTE: We have to add the external doc refs first so that the ExternalMap will be properly populated |
584 | 584 | for (org.spdx.library.model.v2.ExternalDocumentRef externalDocRef:fromDoc.getExternalDocumentRefs()) { |
585 | | - toDoc.getNamespaceMaps().add(convertAndStore(externalDocRef, toDoc.getImportss())); |
| 585 | + toDoc.getNamespaceMaps().add(convertAndStore(externalDocRef, toDoc.getSpdxImports())); |
586 | 586 | } |
587 | 587 | convertElementProperties(fromDoc, toDoc); |
588 | 588 | toDoc.setCreationInfo(convertCreationInfo(fromDoc.getCreationInfo(), this.toModelStore, this.defaultUriPrefix)); |
@@ -1055,15 +1055,15 @@ public Hash convertAndStore(org.spdx.library.model.v2.Checksum checksum) throws |
1055 | 1055 | private void convertAndAddFileType(org.spdx.library.model.v2.enumerations.FileType fileType, SpdxFile file) throws InvalidSPDXAnalysisException { |
1056 | 1056 | switch (fileType) { |
1057 | 1057 | case ARCHIVE: addSoftwarePurpose(SoftwarePurpose.ARCHIVE, file); break; |
1058 | | - case BINARY: file.setSoftwareContentType("application/octet-stream"); break; |
| 1058 | + case BINARY: file.setContentType("application/octet-stream"); break; |
1059 | 1059 | case SOURCE: addSoftwarePurpose(SoftwarePurpose.SOURCE, file); break; |
1060 | | - case TEXT: file.setSoftwareContentType("text/plain"); break; |
| 1060 | + case TEXT: file.setContentType("text/plain"); break; |
1061 | 1061 | case APPLICATION: addSoftwarePurpose(SoftwarePurpose.APPLICATION, file); break; |
1062 | | - case AUDIO: file.setSoftwareContentType("audio/*"); break; |
1063 | | - case IMAGE: file.setSoftwareContentType("image/*"); break; |
1064 | | - case VIDEO: file.setSoftwareContentType("video/*"); break; |
| 1062 | + case AUDIO: file.setContentType("audio/*"); break; |
| 1063 | + case IMAGE: file.setContentType("image/*"); break; |
| 1064 | + case VIDEO: file.setContentType("video/*"); break; |
1065 | 1065 | case DOCUMENTATION: addSoftwarePurpose(SoftwarePurpose.DOCUMENTATION, file); break; |
1066 | | - case SPDX: file.setSoftwareContentType("text/spdx"); break; |
| 1066 | + case SPDX: file.setContentType("text/spdx"); break; |
1067 | 1067 | case OTHER: addSoftwarePurpose(SoftwarePurpose.OTHER, file); break; |
1068 | 1068 |
|
1069 | 1069 | default: throw new InvalidSPDXAnalysisException("Unknown file type "+fileType); |
|
0 commit comments