Class LicenseRdfFormatWriter
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseRdfFormatWriter
- All Implemented Interfaces:
ILicenseFormatWriter
Write RDF formats for the licenses
- Author:
- Gary O'Neall
-
Constructor Summary
ConstructorsConstructorDescriptionLicenseRdfFormatWriter(File rdfXml, File rdfTurtle, File rdfNt, File rdfJsonLd) -
Method Summary
Modifier and TypeMethodDescriptiongetRdfNt()voidvoidsetRdfTurtle(File rdfTurtle) voidvoidwriteException(ListedExceptionContainer exceptionContainer) voidwriteLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) Formats and writes a specific licensestatic voidwriteRdf(org.spdx.spdxRdfStore.RdfStore rdfStore, String documentUri, String fileName, org.spdx.spdxRdfStore.OutputFormat format) Write an RDF file for for all elements in the containervoidwriteToC()Write the Table of Contents file for the format if applicable
-
Constructor Details
-
LicenseRdfFormatWriter
public LicenseRdfFormatWriter(File rdfXml, File rdfTurtle, File rdfNt, File rdfJsonLd) throws org.spdx.core.InvalidSPDXAnalysisException - Parameters:
rdfXml- File to store RDF XML formatted license listrdfTurtle- File to store RDF Turtle formatted license listrdfNt- File to store RDF Nt formatted license listrdfJsonLd- File to store JSON-LD formatted license list- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
-
Method Details
-
getRdfXml
- Returns:
- the rdfXml
-
setRdfXml
- Parameters:
rdfXml- the rdfXml to set
-
getRdfTurtle
- Returns:
- the rdfTurtle
-
setRdfTurtle
- Parameters:
rdfTurtle- the rdfTurtle to set
-
getRdfNt
- Returns:
- the rdfNt
-
setRdfNt
- Parameters:
rdfNt- the rdfNt to set
-
writeLicense
public void writeLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) throws IOException, LicenseGeneratorException, org.spdx.core.InvalidSPDXAnalysisException Description copied from interface:ILicenseFormatWriterFormats and writes a specific license- Specified by:
writeLicensein interfaceILicenseFormatWriter- Parameters:
licenseContainer- License to be addeddeprecated- True if deprecateddeprecatedVersion- License list version when the license was deprecated, null otherwise- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.core.InvalidSPDXAnalysisException
-
writeRdf
public static void writeRdf(org.spdx.spdxRdfStore.RdfStore rdfStore, String documentUri, String fileName, org.spdx.spdxRdfStore.OutputFormat format) throws LicenseGeneratorException Write an RDF file for for all elements in the container- Parameters:
rdfStore- Store for the RDF elementsdocumentUri- Document URI containing the elements to be writtenfileName- File name to write the elements toformat- Jena RDF format- Throws:
LicenseGeneratorException
-
writeToC
Description copied from interface:ILicenseFormatWriterWrite the Table of Contents file for the format if applicable- Specified by:
writeToCin interfaceILicenseFormatWriter- Throws:
IOExceptionLicenseGeneratorException
-
writeException
public void writeException(ListedExceptionContainer exceptionContainer) throws IOException, LicenseGeneratorException, org.spdx.core.InvalidSPDXAnalysisException - Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exceptionContainer- Exception to be formatted and written- Throws:
IOExceptionLicenseGeneratorExceptionorg.spdx.core.InvalidSPDXAnalysisException
-