keith-turner commented on code in PR #53:
URL: 
https://github.com/apache/accumulo-classloaders/pull/53#discussion_r2721707152


##########
modules/local-caching-classloader/src/main/java/org/apache/accumulo/classloader/lcc/definition/ContextDefinition.java:
##########
@@ -67,13 +111,13 @@ static class Opts extends Help {
 
   @SuppressFBWarnings(value = "URLCONNECTION_SSRF_FD",
       justification = "user-supplied URL is the intended functionality")
-  public static ContextDefinition create(int monitorIntervalSecs, URL... 
sources)
+  public static ContextDefinition create(int monitorIntervalSecs, String 
algorithm, URL... sources)
       throws IOException {
     LinkedHashSet<Resource> resources = new LinkedHashSet<>();
     for (URL u : sources) {
-      try (InputStream is = u.openStream()) {
-        String checksum = DIGESTER.digestAsHex(is);
-        resources.add(new Resource(u, checksum));
+      try (InputStream is = new BufferedInputStream(u.openStream())) {
+        String checksum = getDigester(algorithm).digestAsHex(is);
+        resources.add(new Resource(u, algorithm, checksum));

Review Comment:
   Could the algorithm be moved from Resource to ContextDef?  It will be the 
same for all resources, so could have it a single time in the json if it was 
moved.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to