Package org.spdx.spdx_to_osv
Class Main
java.lang.Object
org.spdx.spdx_to_osv.Main
public class Main extends Object
Utility to produce an OSV JSON file from an SPDX file
See https://osv.dev/ for information on OSV
The utility produces an output file OSVOutput.json in the OSV JSON format
See https://docs.google.com/document/d/1sylBGNooKtf220RHQn1I8pZRmqXZQADDQ_TOABrKTpA/edit for output format
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description Main() -
Method Summary
Modifier and Type Method Description static voidmain(String[] args)static voidspdxToOsv(File fromFile, File toFile, org.spdx.tools.SpdxToolsHelper.SerFileType inputFileType, boolean allPackages)Produce an OSV Output File from an SPDX input filestatic voidspdxToOsv(InputStream inStream, org.spdx.tools.SpdxToolsHelper.SerFileType inputFileType, Writer writer, boolean allPackages)Writes OSV JSON data to the outStream based on an SPDX input streamstatic voidspdxToOsv(org.spdx.storage.IModelStore fromStore, String documentUri, Writer writer, boolean allPackages)Writes OSV JSON data to the outStream based on an SPDX model store and document URI
-
Constructor Details
-
Main
public Main()
-
-
Method Details
-
main
- Parameters:
args- args[0] input SPDX file, args[1] output OSV JSON file
-
spdxToOsv
public static void spdxToOsv(File fromFile, File toFile, org.spdx.tools.SpdxToolsHelper.SerFileType inputFileType, boolean allPackages) throws SpdxToOsvException, IOExceptionProduce an OSV Output File from an SPDX input file- Parameters:
fromFile- SPDX input filetoFile- OSV output fileinputFileType- Input file type for the SPDX fileallPackage- if true, scan all packages in the document- Throws:
SpdxToOsvExceptionIOException
-
spdxToOsv
public static void spdxToOsv(org.spdx.storage.IModelStore fromStore, String documentUri, Writer writer, boolean allPackages) throws SpdxToOsvException, IOException, org.spdx.library.InvalidSPDXAnalysisExceptionWrites OSV JSON data to the outStream based on an SPDX model store and document URI- Parameters:
fromStore- Model store containing the SPDX modeldocumentUri- Document URI for the document to usewriter- writer the OSV fileallPackage- if true, scan all packages in the document- Throws:
SpdxToOsvExceptionIOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
spdxToOsv
public static void spdxToOsv(InputStream inStream, org.spdx.tools.SpdxToolsHelper.SerFileType inputFileType, Writer writer, boolean allPackages) throws SpdxToOsvExceptionWrites OSV JSON data to the outStream based on an SPDX input stream- Parameters:
inStream- Stream for the SPDX fileinputFileType- Serialization type for the input file streamwriter- writer the OSV fileallPackage- if true, scan all packages in the document- Throws:
SpdxToOsvException
-