Package org.spdx.tools
Class SpdxConverter
java.lang.Object
org.spdx.tools.SpdxConverter
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidConvert an SPDX file from the fromFilePath to a new file at the toFilePath using the file extensions to determine the serialization typestatic voidconvert(String fromFilePath, String toFilePath, SpdxToolsHelper.SerFileType fromFileType, SpdxToolsHelper.SerFileType toFileType) Convert an SPDX file from the fromFilePath to a new file at the toFilePath including listed license property detailsstatic voidconvert(String fromFilePath, String toFilePath, SpdxToolsHelper.SerFileType fromFileType, SpdxToolsHelper.SerFileType toFileType, boolean excludeLicenseDetails) Convert an SPDX file from the fromFilePath to a new file at the toFilePathstatic void
-
Constructor Details
-
SpdxConverter
public SpdxConverter()
-
-
Method Details
-
main
- Parameters:
args-
-
convert
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 fromtoFilePath- 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 fromtoFilePath- Path of output file for the conversionfromFileType- Serialization type of the file to convert fromtoFileType- 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 fromtoFilePath- Path of output file for the conversionfromFileType- Serialization type of the file to convert fromtoFileType- Serialization type of the file to convert toexcludeLicenseDetails- If true, don't copy over properties of the listed licenses- Throws:
SpdxConverterException
-