Class SpdxConverter

java.lang.Object
org.spdx.tools.SpdxConverter

public class SpdxConverter extends Object
Converts between various SPDX file types arg[0] from file path arg[1] to file path arg[2] from file type [RDFXML|RDFTTL|JSON|XLS|XLSX|YAML|TAG] - if not present, file type of the from file will be used arg[3] to file type [RDFXML|RDFTTL|JSON|XLS|XLSX|YAML|TAG] - if not present, file type of the to file will be used arg[4] excludeLicenseDetails If present, listed license and listed exception properties will not be included in the output file the covert(...) methods can be called programmatically to convert files
Author:
Gary O'Neall
  • Constructor Details

    • SpdxConverter

      public SpdxConverter()
  • Method Details

    • main

      public static void main(String[] args)
      Parameters:
      args -
    • convert

      public static void convert(String fromFilePath, String toFilePath) throws SpdxConverterException
      Convert an SPDX file from the fromFilePath to a new file at the toFilePath using the file extensions to determine the serialization type
      Parameters:
      fromFilePath - Path of the file to convert from
      toFilePath - Path of output file for the conversion
      Throws:
      SpdxConverterException
    • convert

      public static void convert(String fromFilePath, String toFilePath, SpdxToolsHelper.SerFileType fromFileType, SpdxToolsHelper.SerFileType toFileType) throws SpdxConverterException
      Convert an SPDX file from the fromFilePath to a new file at the toFilePath including listed license property details
      Parameters:
      fromFilePath - Path of the file to convert from
      toFilePath - Path of output file for the conversion
      fromFileType - Serialization type of the file to convert from
      toFileType - Serialization type of the file to convert to
      Throws:
      SpdxConverterException
    • convert

      public static void convert(String fromFilePath, String toFilePath, SpdxToolsHelper.SerFileType fromFileType, SpdxToolsHelper.SerFileType toFileType, boolean excludeLicenseDetails) throws SpdxConverterException
      Convert an SPDX file from the fromFilePath to a new file at the toFilePath
      Parameters:
      fromFilePath - Path of the file to convert from
      toFilePath - Path of output file for the conversion
      fromFileType - Serialization type of the file to convert from
      toFileType - Serialization type of the file to convert to
      excludeLicenseDetails - If true, don't copy over properties of the listed licenses
      Throws:
      SpdxConverterException