Package org.spdx.rdfparser
Class SPDXDocumentFactory
java.lang.Object
org.spdx.rdfparser.SPDXDocumentFactory
public class SPDXDocumentFactory extends Object
Factory for creating an SPDX Document from a variety of different sources
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description SPDXDocumentFactory() -
Method Summary
Modifier and Type Method Description static SPDXDocumentcreateLegacySpdxDocument(InputStream input, String baseUri, String fileType)static SPDXDocumentcreateLegacySpdxDocument(String fileNameOrUrl)Create an Legacy SPDX Document from a file - Legacy SPDX documents only specification version 1.2 featuresstatic SPDXDocumentcreateLegacySpdxDocument(org.apache.jena.rdf.model.Model model)Create a new Legacy SPDX Document populating the data from the existing model Legacy SPDX documents only specification version 1.2 featuresstatic SpdxDocumentcreateSpdxDocument(InputStream input, String baseUri, String fileType)static SpdxDocumentcreateSpdxDocument(String fileNameOrUrl)Create an SPDX Document from a filestatic SpdxDocumentcreateSpdxDocument(org.apache.jena.rdf.model.Model model)Create a new SPDX Document populating the data from the existing model
-
Constructor Details
-
SPDXDocumentFactory
public SPDXDocumentFactory()
-
-
Method Details
-
createSpdxDocument
public static SpdxDocument createSpdxDocument(org.apache.jena.rdf.model.Model model) throws InvalidSPDXAnalysisExceptionCreate a new SPDX Document populating the data from the existing model- Parameters:
model-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
createLegacySpdxDocument
public static SPDXDocument createLegacySpdxDocument(org.apache.jena.rdf.model.Model model) throws InvalidSPDXAnalysisExceptionCreate a new Legacy SPDX Document populating the data from the existing model Legacy SPDX documents only specification version 1.2 features- Parameters:
model-- Returns:
- Throws:
InvalidSPDXAnalysisException
-
createLegacySpdxDocument
public static SPDXDocument createLegacySpdxDocument(String fileNameOrUrl) throws IOException, InvalidSPDXAnalysisExceptionCreate an Legacy SPDX Document from a file - Legacy SPDX documents only specification version 1.2 features- Parameters:
fileNameOrUrl- local file name or Url containing the SPDX data. Can be in RDF/XML or RDFa format- Returns:
- SPDX Document initialized with the exsiting data
- Throws:
IOExceptionInvalidSPDXAnalysisException
-
createSpdxDocument
public static SpdxDocument createSpdxDocument(String fileNameOrUrl) throws IOException, InvalidSPDXAnalysisExceptionCreate an SPDX Document from a file- Parameters:
fileNameOrUrl- local file name or Url containing the SPDX data. Can be in RDF/XML or RDFa format- Returns:
- SPDX Document initialized with the exsiting data
- Throws:
IOExceptionInvalidSPDXAnalysisException
-
createSpdxDocument
public static SpdxDocument createSpdxDocument(InputStream input, String baseUri, String fileType) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
createLegacySpdxDocument
public static SPDXDocument createLegacySpdxDocument(InputStream input, String baseUri, String fileType) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-