Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/examples/java/org/spdx/example/Spdx3Example.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**
* Example which creates an SBOM from scratch
*
* <p>
* NOTE: Snippets from this file are used in the GETTING_STARTED.md file - any changes to this file
* should update the GETTING_STARTED.md file
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
public interface IFileChecksumGenerator {
/**
* Generate a checksum for the file
*
* @param file File to generate the checksum for
* @return the checksum for the file
* @throws IOException on errors reading the file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.security.NoSuchAlgorithmException;

/**
* Java sha1 checksum generator using MessageDigest
* Java SHA1 checksum generator using MessageDigest
*
* @author Gary O'Neall
*/
Expand All @@ -35,13 +35,15 @@ public class JavaSha1ChecksumGenerator implements IFileChecksumGenerator {

/**
* Create a SHA1 based checksum generator
*
* @throws NoSuchAlgorithmException if the SHA1 algorithm does not exist
*/
public JavaSha1ChecksumGenerator() throws NoSuchAlgorithmException {
this.digest = MessageDigest.getInstance(SHA1_ALGORITHM);
}

/**
* Generate a checksum for the file using SHA1
*
* @param file File to generate the checksum for
* @return file checksum
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ public SpdxPackageVerificationCode generatePackageVerificationCode(File sourceDi
}

/**
* Generate the SPDX Package Verification Code from a list of file checksums
*
* @param fileChecksums used to create the verification code value
* @param skippedFilePaths list of files skipped when calculating the verification code
* @param modelStore where the resultant VerificationCode is store
Expand Down Expand Up @@ -150,8 +152,9 @@ protected SpdxPackageVerificationCode generatePackageVerificationCode(List<Strin

/**
* Collect the file level checksums and filenames
*
* @param prefixForRelative The portion of the filepath which precedes the relative file path for the archive
* @param sourceDirectory directory to collectd the file data from
* @param sourceDirectory directory to collect the file data from
* @param fileNameAndChecksums resultant list of file names and checksums - added to in this method
* @param skippedFiles files to be ignored in the package verification result
* @throws IOException on IO error reading the directory of file
Expand Down Expand Up @@ -229,7 +232,10 @@ private static String convertChecksumToString(byte[] digest) {
}
return sb.toString();
}

/**
* Generate the SPDX Package Verification Code from a directory of files included in the archive
*
* @param sourceDirectory directory to create the verification code for
* @param modelStore where the resultant VerificationCode is store
* @param documentUri document URI where the VerificationCode is stored
Expand Down