File tree Expand file tree Collapse file tree
src/main/java/org/spdx/utility/verificationcode Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 */
2828public interface IFileChecksumGenerator {
2929 /**
30+ * Generate a checksum for the file
31+ *
3032 * @param file File to generate the checksum for
3133 * @return the checksum for the file
3234 * @throws IOException on errors reading the file
Original file line number Diff line number Diff line change 2424import java .security .NoSuchAlgorithmException ;
2525
2626/**
27- * Java sha1 checksum generator using MessageDigest
27+ * Java SHA1 checksum generator using MessageDigest
2828 *
2929 * @author Gary O'Neall
3030 */
@@ -35,13 +35,15 @@ public class JavaSha1ChecksumGenerator implements IFileChecksumGenerator {
3535
3636 /**
3737 * Create a SHA1 based checksum generator
38+ *
3839 * @throws NoSuchAlgorithmException if the SHA1 algorithm does not exist
3940 */
4041 public JavaSha1ChecksumGenerator () throws NoSuchAlgorithmException {
4142 this .digest = MessageDigest .getInstance (SHA1_ALGORITHM );
4243 }
4344
4445 /**
46+ * Generate a checksum for the file using SHA1
4547 *
4648 * @param file File to generate the checksum for
4749 * @return file checksum
Original file line number Diff line number Diff line change @@ -123,6 +123,8 @@ public SpdxPackageVerificationCode generatePackageVerificationCode(File sourceDi
123123 }
124124
125125 /**
126+ * Generate the SPDX Package Verification Code from a list of file checksums
127+ *
126128 * @param fileChecksums used to create the verification code value
127129 * @param skippedFilePaths list of files skipped when calculating the verification code
128130 * @param modelStore where the resultant VerificationCode is store
@@ -150,8 +152,9 @@ protected SpdxPackageVerificationCode generatePackageVerificationCode(List<Strin
150152
151153 /**
152154 * Collect the file level checksums and filenames
155+ *
153156 * @param prefixForRelative The portion of the filepath which precedes the relative file path for the archive
154- * @param sourceDirectory directory to collectd the file data from
157+ * @param sourceDirectory directory to collect the file data from
155158 * @param fileNameAndChecksums resultant list of file names and checksums - added to in this method
156159 * @param skippedFiles files to be ignored in the package verification result
157160 * @throws IOException on IO error reading the directory of file
@@ -229,7 +232,10 @@ private static String convertChecksumToString(byte[] digest) {
229232 }
230233 return sb .toString ();
231234 }
235+
232236 /**
237+ * Generate the SPDX Package Verification Code from a directory of files included in the archive
238+ *
233239 * @param sourceDirectory directory to create the verification code for
234240 * @param modelStore where the resultant VerificationCode is store
235241 * @param documentUri document URI where the VerificationCode is stored
You can’t perform that action at this time.
0 commit comments