Add clearAll(String)

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/879742c0
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/879742c0
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/879742c0

Branch: refs/heads/master
Commit: 879742c087fd73c665cfa12cfdd63d875d9b49f4
Parents: 906be05
Author: Andy Seaborne <a...@apache.org>
Authored: Fri Nov 7 12:23:53 2014 +0000
Committer: Andy Seaborne <a...@apache.org>
Committed: Fri Nov 7 12:23:53 2014 +0000

----------------------------------------------------------------------
 .../src/main/java/org/apache/jena/atlas/lib/FileOps.java     | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/879742c0/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java 
b/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
index 98a8616..6862f4a 100644
--- a/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
+++ b/jena-arq/src/main/java/org/apache/jena/atlas/lib/FileOps.java
@@ -74,7 +74,15 @@ public class FileOps {
     }
 
     /** Delete all files and directories (recursively) in a directory */
+    public static void clearAll(String d) {
+        clearAll(new File(d)) ;
+    }
+
+    /** Delete all files and directories (recursively) in a directory */
     public static void clearAll(File d) {
+        if ( ! d.exists() )
+            return ;
+        
         for ( File f : d.listFiles() ) {
             if ( ".".equals(f.getName()) || "..".equals(f.getName()) )
                 continue ;

Reply via email to