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

    • LicenseTextFormatWriter

      public LicenseTextFormatWriter(File textFolder)
      Parameters:
      textFolder - Folder to write the text files
  • 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(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion, boolean wordWrapText) throws org.spdx.core.InvalidSPDXAnalysisException, IOException
      Parameters:
      licenseContainer - license to write
      deprecated - true if deprecated
      deprecatedVersion - version deprecated in
      wordWrapText - if true, reformat the license text wrapping words
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException
      IOException
    • writeLicense

      public void writeLicense(ListedLicenseContainer licenseContainer, boolean deprecated, String deprecatedVersion) throws IOException, org.spdx.core.InvalidSPDXAnalysisException
      Description copied from interface: ILicenseFormatWriter
      Formats and writes a specific license
      Specified by:
      writeLicense in interface ILicenseFormatWriter
      Parameters:
      licenseContainer - License to be added
      deprecated - True if deprecated
      deprecatedVersion - License list version when the license was deprecated, null otherwise
      Throws:
      IOException
      org.spdx.core.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(ListedExceptionContainer exceptionContainer) throws IOException, org.spdx.core.InvalidSPDXAnalysisException
      Specified by:
      writeException in interface ILicenseFormatWriter
      Parameters:
      exceptionContainer - Exception to be formatted and written
      Throws:
      IOException
      org.spdx.core.InvalidSPDXAnalysisException