ctubbsii commented on code in PR #35:
URL: 
https://github.com/apache/accumulo-classloaders/pull/35#discussion_r2628535130


##########
modules/local-caching-classloader/src/main/java/org/apache/accumulo/classloader/lcc/cache/CacheUtils.java:
##########
@@ -73,26 +92,27 @@ public void unlock() throws IOException {
 
   }
 
-  private static Path mkdir(final Path p) throws IOException {
-    try {
-      return Files.createDirectory(p, PERMISSIONS);
-    } catch (FileAlreadyExistsException e) {
-      return p;
+  public static void createBaseDirs(final Path baseDir)
+      throws IOException, ContextClassLoaderException {
+    if (baseDir == null) {
+      throw new ContextClassLoaderException("received null for cache 
directory");
     }
+    var contextDir = baseDir.resolve("contexts");
+    Files.createDirectories(contextDir, PERMISSIONS);

Review Comment:
   The intent is to behave like `mkdir -p`, in as few calls as possible, 
similar to the previous code, but removing the explicit creation of base dir, 
because it's redundant when using `Files.createDirectories` on the child.



-- 
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