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 Details

  • Method Details

    • getTextFolder

      public File getTextFolder()
      Returns:
      Folder to write the text files
    • setTextFolder

      public void setTextFolder​(File textFolder)
      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 write
      deprecated - true if deprecated
      deprecatedVersion - version deprecated in
      wordWrapText - if true, reformat the license text wrapping words
      Throws:
      org.spdx.library.InvalidSPDXAnalysisException
      IOException
    • writeLicense

      public void writeLicense​(org.spdx.library.model.license.SpdxListedLicense license, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.library.InvalidSPDXAnalysisException
      Description copied from interface: ILicenseFormatWriter
      Formats and writes a specific license
      Specified by:
      writeLicense in interface ILicenseFormatWriter
      Parameters:
      license - License to be added
      deprecated - True if deprecated
      deprecatedVersion - License list version when the license was deprecated, null otherwise
      Throws:
      IOException
      org.spdx.library.InvalidSPDXAnalysisException
    • writeToC

      public void writeToC() throws IOException
      Description copied from interface: ILicenseFormatWriter
      Write the Table of Contents file for the format if applicable
      Specified by:
      writeToC in interface ILicenseFormatWriter
      Throws:
      IOException
    • writeException

      public void writeException​(org.spdx.library.model.license.ListedLicenseException exception) throws IOException, org.spdx.library.InvalidSPDXAnalysisException
      Specified by:
      writeException in interface ILicenseFormatWriter
      Parameters:
      exception - Exception to be formatted and written
      Throws:
      IOException
      org.spdx.library.InvalidSPDXAnalysisException