You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2022/08/01 08:35:52 UTC

[GitHub] [jena] rvesse commented on a diff in pull request #1458: Accumulated small changes

rvesse commented on code in PR #1458:
URL: https://github.com/apache/jena/pull/1458#discussion_r934275094


##########
jena-base/src/main/java/org/apache/jena/atlas/lib/FileOps.java:
##########
@@ -63,12 +63,19 @@ public static void delete(File f, boolean reportExistsAfter) {
         }
     }
 
-    /** Delete all files in a directory */
+    /**
+     * Delete all files in a directory.
+     * Does nothing if the path name does not exist or is not a directory.
+     *
+     * @param dir
+     */
     public static void clearDirectory(String dir) {
         File d = new File(dir) ;
-        for ( File f : d.listFiles() ) {
-            if ( f.isFile() )
-                delete(f, false) ;
+        if ( d.isDirectory() ) {
+            for ( File f : d.listFiles() ) {
+                if ( f.isFile() )

Review Comment:
   I take it this never needs to recurse into further levels of directory?



-- 
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: pr-unsubscribe@jena.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org