Class SpdxV3FileCollector

java.lang.Object
org.spdx.maven.utils.AbstractFileCollector
org.spdx.maven.utils.SpdxV3FileCollector

public class SpdxV3FileCollector extends AbstractFileCollector
Collects SPDX file information from directories in SPDX Spec version 3 format

The method collectFilesInDirectory(FileSet[] filesets) will scan and create SPDX File information for all files in the filesets.

Author:
Gary O'Neall
  • Constructor Details

    • SpdxV3FileCollector

      public SpdxV3FileCollector(List<org.spdx.library.model.v3_0_1.core.DictionaryEntry> customIdToUri)
      SpdxFileCollector collects SPDX file information for files
      Parameters:
      customIdToUri - Holds a mapping of IDs to URIs for any custom licenses defined outside the spdxDoc
  • Method Details

    • collectFiles

      public void collectFiles(List<org.apache.maven.shared.model.fileset.FileSet> fileSets, String baseDir, SpdxDefaultFileInformation defaultFileInformation, Map<String,SpdxDefaultFileInformation> pathSpecificInformation, org.spdx.library.model.v3_0_1.software.SpdxPackage projectPackage, org.spdx.library.model.v3_0_1.core.RelationshipType relationshipType, org.spdx.library.model.v3_0_1.core.SpdxDocument spdxDoc, Set<String> algorithms) throws SpdxCollectionException
      Collect file information in the directory (including subdirectories).
      Parameters:
      fileSets - FileSets containing the description of the directory to be scanned
      baseDir - project base directory used to construct the relative paths for the SPDX files
      defaultFileInformation - Information on default SPDX field data for the files
      pathSpecificInformation - Map of path to file information used to override the default file information
      relationshipType - Type of relationship to the project package
      projectPackage - Package to which the files belong
      spdxDoc - SPDX document which contains the extracted license infos that may be needed for license parsing
      Throws:
      SpdxCollectionException - on incompatible types in an SPDX collection
    • getFiles

      public Collection<org.spdx.library.model.v3_0_1.software.SpdxFile> getFiles()
      Returns:
      SPDX Files which have been acquired through the collectFilesInDirectory method
    • getSnippets

      public List<org.spdx.library.model.v3_0_1.software.Snippet> getSnippets()
      Returns:
      SPDX Snippets collected through the collectFilesInDirectory method