Class CycloneToSpdx

java.lang.Object
org.spdx.cdx2spdx.CycloneToSpdx

public class CycloneToSpdx extends Object
Converts between CycloneDX and SPDX Based on the spreadsheet https://docs.google.com/spreadsheets/d/1PIiSYLJHlt8djG5OoOYniy_I-J31UMhBKQ62UUBHKVA/edit?usp=sharing
Author:
Gary O'Neall
  • Constructor Details

    • CycloneToSpdx

      public CycloneToSpdx()
  • Method Details

    • fileTypeToStore

      public static org.spdx.storage.ISerializableModelStore fileTypeToStore(CycloneToSpdx.SerFileType fileType) throws org.spdx.library.InvalidSPDXAnalysisException
      Parameters:
      fileType - file type for the store
      Returns:
      the appropriate in memory based model store which supports serialization for the fileType
      Throws:
      org.spdx.library.InvalidSPDXAnalysisException
    • fileToFileType

      public static CycloneToSpdx.SerFileType fileToFileType(File file) throws InvalidFileNameException
      Parameters:
      file -
      Returns:
      the file type based on the file name and file extension
      Throws:
      InvalidFileNameException
    • main

      public static void main(String[] args)
      Parameters:
      args - args[0] filename to convert from; args[1] filename to convert to
    • cycloneDxToSpdx

      public static List<String> cycloneDxToSpdx(String cycloneDxFilePath, String spdxFilePath) throws CycloneConversionException
      Parameters:
      cycloneDxFilePath -
      spdxFilePath -
      Throws:
      CycloneConversionException