Skip to content

Commit a7db3f5

Browse files
bactgoneall
authored andcommitted
Add Javadoc to org.spdx.utility.verificationcode
Signed-off-by: Arthit Suriyawongkul <arthit@gmail.com>
1 parent 718fd65 commit a7db3f5

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/main/java/org/spdx/utility/verificationcode/IFileChecksumGenerator.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
*/
2828
public 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

src/main/java/org/spdx/utility/verificationcode/JavaSha1ChecksumGenerator.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import 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

src/main/java/org/spdx/utility/verificationcode/VerificationCodeGenerator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)