public class VerificationCodeGenerator extends Object
SPDXFiles.
A class implementing the IFileChecksumGenerator is supplied as a parameter to the constructor.
The method getFileChecksum is called for each file in the directory. This can
be used as a hook to capture all files in the directory and capture the checksum values at
a file level.| Constructor and Description |
|---|
VerificationCodeGenerator(IFileChecksumGenerator fileChecksumGenerator) |
| Modifier and Type | Method and Description |
|---|---|
SpdxPackageVerificationCode |
generatePackageVerificationCode(File sourceDirectory) |
SpdxPackageVerificationCode |
generatePackageVerificationCode(File sourceDirectory,
File[] skippedFiles)
Generate the SPDX Package Verification Code from a directory of files included in the archive
|
protected SpdxPackageVerificationCode |
generatePackageVerificationCode(List<String> fileChecksums,
String[] skippedFilePaths) |
SpdxPackageVerificationCode |
generatePackageVerificationCode(SpdxFile[] spdxFiles,
String[] skippedFilePaths)
Generate the SPDX Package Verification Code from an array of SPDXFiles
|
static String |
normalizeFilePath(String nonNormalizedFilePath)
Normalizes a file path per the SPDX spec
|
public VerificationCodeGenerator(IFileChecksumGenerator fileChecksumGenerator)
public SpdxPackageVerificationCode generatePackageVerificationCode(SpdxFile[] spdxFiles, String[] skippedFilePaths) throws NoSuchAlgorithmException
spdxFiles - Files to generate the VerificationCode fromskippedFilePaths - File path names to not include in the VerificationCodeNoSuchAlgorithmExceptionpublic SpdxPackageVerificationCode generatePackageVerificationCode(File sourceDirectory, File[] skippedFiles) throws NoSuchAlgorithmException, IOException
sourceDirectory - NoSuchAlgorithmExceptionIOExceptionprotected SpdxPackageVerificationCode generatePackageVerificationCode(List<String> fileChecksums, String[] skippedFilePaths) throws NoSuchAlgorithmException
NoSuchAlgorithmExceptionpublic static String normalizeFilePath(String nonNormalizedFilePath)
nonNormalizedFilePath - public SpdxPackageVerificationCode generatePackageVerificationCode(File sourceDirectory) throws NoSuchAlgorithmException, IOException
sourceDirectory - skippedFiles - NoSuchAlgorithmExceptionIOExceptionCopyright © 2018 Linux Foundation. All Rights Reserved.