Package org.spdx.maven.utils
Class SpdxV3FileCollector
java.lang.Object
org.spdx.maven.utils.AbstractFileCollector
org.spdx.maven.utils.SpdxV3FileCollector
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
-
Field Summary
Fields inherited from class org.spdx.maven.utils.AbstractFileCollector
CHECKSUM_ALGORITHMS, EXT_TO_FILE_TYPE, LOG -
Constructor Summary
ConstructorsConstructorDescriptionSpdxV3FileCollector(List<org.spdx.library.model.v3_0_1.core.DictionaryEntry> customIdToUri) SpdxFileCollector collects SPDX file information for files -
Method Summary
Modifier and TypeMethodDescriptionvoidcollectFiles(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) Collect file information in the directory (including subdirectories).Collection<org.spdx.library.model.v3_0_1.software.SpdxFile>getFiles()List<org.spdx.library.model.v3_0_1.software.Snippet>Methods inherited from class org.spdx.maven.utils.AbstractFileCollector
convertChecksumToString, convertFilePathToSpdxFileName, extensionToFileType, generateChecksum, generateSha1, getExtension, isSourceFile, toRelativeFilePath
-
Constructor Details
-
SpdxV3FileCollector
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 SpdxCollectionExceptionCollect file information in the directory (including subdirectories).- Parameters:
fileSets- FileSets containing the description of the directory to be scannedbaseDir- project base directory used to construct the relative paths for the SPDX filesdefaultFileInformation- Information on default SPDX field data for the filespathSpecificInformation- Map of path to file information used to override the default file informationrelationshipType- Type of relationship to the project packageprojectPackage- Package to which the files belongspdxDoc- SPDX document which contains the extracted license infos that may be needed for license parsingalgorithms- algorithms to use to generate checksums- Throws:
SpdxCollectionException- on incompatible types in an SPDX collection
-
getFiles
- Returns:
- SPDX Files which have been acquired through the collectFilesInDirectory method
-
getSnippets
- Returns:
- SPDX Snippets collected through the collectFilesInDirectory method
-