Class LicenseTextFormatWriter
java.lang.Object
org.spdx.licenselistpublisher.licensegenerator.LicenseTextFormatWriter
- All Implemented Interfaces:
ILicenseFormatWriter
public class LicenseTextFormatWriter extends Object implements ILicenseFormatWriter
Writes licenses in a simple text format
- Author:
- Gary O'Neall
-
Constructor Summary
Constructors Constructor Description LicenseTextFormatWriter(File textFolder) -
Method Summary
Modifier and Type Method Description FilegetTextFolder()voidsetTextFolder(File textFolder)voidwriteException(org.spdx.library.model.license.ListedLicenseException exception)voidwriteLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion)Formats and writes a specific licensevoidwriteLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion, boolean wordWrapText)voidwriteToC()Write the Table of Contents file for the format if applicable
-
Constructor Details
-
LicenseTextFormatWriter
- Parameters:
textFolder- Folder to write the text files
-
-
Method Details
-
getTextFolder
- Returns:
- Folder to write the text files
-
setTextFolder
- Parameters:
textFolder- Folder to write the text files
-
writeLicense
public void writeLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion, boolean wordWrapText) throws org.spdx.library.InvalidSPDXAnalysisException, IOException- Parameters:
license- license to writedeprecated- true if deprecateddeprecatedVersion- version deprecated inwordWrapText- if true, reformat the license text wrapping words- Throws:
org.spdx.library.InvalidSPDXAnalysisExceptionIOException
-
writeLicense
public void writeLicense(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.library.InvalidSPDXAnalysisExceptionDescription copied from interface:ILicenseFormatWriterFormats and writes a specific license- Specified by:
writeLicensein interfaceILicenseFormatWriter- Parameters:
license- License to be addeddeprecated- True if deprecateddeprecatedVersion- License list version when the license was deprecated, null otherwise- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-
writeToC
Description copied from interface:ILicenseFormatWriterWrite the Table of Contents file for the format if applicable- Specified by:
writeToCin interfaceILicenseFormatWriter- Throws:
IOException
-
writeException
public void writeException(org.spdx.library.model.license.ListedLicenseException exception) throws IOException, org.spdx.library.InvalidSPDXAnalysisException- Specified by:
writeExceptionin interfaceILicenseFormatWriter- Parameters:
exception- Exception to be formatted and written- Throws:
IOExceptionorg.spdx.library.InvalidSPDXAnalysisException
-