ijuma commented on code in PR #15289:
URL: https://github.com/apache/kafka/pull/15289#discussion_r1518680219


##########
clients/src/test/java/org/apache/kafka/test/TestUtils.java:
##########
@@ -195,6 +195,25 @@ public static File tempDirectory() {
         return tempDirectory(null);
     }
 
+    /**
+     * Create a temporary directory under the given root directory.
+     * The root directory is removed on JVM exit if it doesn't already exist
+     * when this function is invoked.
+     *
+     * @param root path to create temporary directory under
+     * @return
+     */
+    public static File tempRelativeDir(String root) {
+        File rootFile = new File(root);
+        boolean created = rootFile.mkdir();
+
+        File result = tempDirectory(rootFile.toPath(), null);
+        if (created) {
+            rootFile.deleteOnExit();

Review Comment:
   Have you verified that the order of these independent removals is correct 
though? I don't think there's any guarantee - that's my point.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to