File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/main/java/org/spdx/tools Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ The file formats can optionally be provided as the 3rd and 4th parameter for the
6262
6363To convert from SPDX 2 to SPDX 3.0.1:
6464
65- * use the file extension ` .jsonld.json ` or ` .jsonld ` ;
65+ * use the file extension ` .spdx3.json ` or ` . jsonld.json` or ` .jsonld ` ;
6666* or add the options for the from and to file types:
6767
6868 java -jar tools-java-2.0.5-jar-with-dependencies.jar Convert hello.spdx hello.spdx.json TAG JSONLD
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ public enum SerFileType {
7070 static Map <String , SerFileType > EXT_TO_FILETYPE ;
7171 static {
7272 HashMap <String , SerFileType > temp = new HashMap <>();
73+ temp .put ("spdx3.json" , SerFileType .JSONLD );
7374 temp .put ("jsonld.json" , SerFileType .JSONLD );
7475 temp .put ("jsonld" , SerFileType .JSONLD );
7576 temp .put ("json" , SerFileType .JSON );
@@ -159,10 +160,14 @@ public static SerFileType fileToFileType(File file)
159160 if (fileName .endsWith ("rdf.ttl" )) {
160161 ext = "rdf.ttl" ;
161162 }
162- }if ("json" .equals (ext )) {
163+ }
164+ if ("json" .equals (ext )) {
163165 if (fileName .endsWith ("jsonld.json" )) {
164166 ext = "jsonld.json" ;
165167 }
168+ if (fileName .endsWith ("spdx3.json" )) {
169+ ext = "spdx3.json" ;
170+ }
166171 }
167172 SerFileType retval = EXT_TO_FILETYPE .get (ext );
168173 if (SerFileType .JSON .equals (retval )) {
You can’t perform that action at this time.
0 commit comments