directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r602677 - in /directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins: AbstractStudioMojo.java StudioCleanMojo.java
Date Sun, 09 Dec 2007 14:43:04 GMT
Author: felixk
Date: Sun Dec  9 06:43:03 2007
New Revision: 602677

URL: http://svn.apache.org/viewvc?rev=602677&view=rev
Log:
Refactor deleteDirectory to AbstractStudioMojo

Modified:
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
    directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java

Modified: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java?rev=602677&r1=602676&r2=602677&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
(original)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
Sun Dec  9 06:43:03 2007
@@ -207,8 +207,8 @@
             throw new MojoExecutionException("Error creating archive", e);
         } catch (ArchiverException e) {
             e.printStackTrace();
-            throw new MojoExecutionException("Error packing file: " + file + " to: " + location
+ "\r\n"
-                    + e.toString(), e);
+            throw new MojoExecutionException(
+                    "Error packing file: " + file + " to: " + location + "\r\n" + e.toString(),
e);
         }
     }
 
@@ -330,6 +330,25 @@
         } catch (Exception e) {
             throw new MojoExecutionException("", e);
         }
+    }
+
+    /**
+     * Delete a directory
+     * 
+     * @param path
+     * @return
+     */
+    protected static boolean deleteDirectory(File path) {
+        if (path.exists()) {
+            for (File file : path.listFiles()) {
+                if (file.isDirectory()) {
+                    deleteDirectory(file);
+                } else {
+                    file.delete();
+                }
+            }
+        }
+        return (path.delete());
     }
 
     /**

Modified: directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java?rev=602677&r1=602676&r2=602677&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
(original)
+++ directory/sandbox/felixk/studio-plugin/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
Sun Dec  9 06:43:03 2007
@@ -63,23 +63,4 @@
             getLog().error(e);
         }
     }
-
-    /**
-     * Delete a directory
-     * 
-     * @param path
-     * @return
-     */
-    private static boolean deleteDirectory(File path) {
-        if (path.exists()) {
-            for (File file : path.listFiles()) {
-                if (file.isDirectory()) {
-                    deleteDirectory(file);
-                } else {
-                    file.delete();
-                }
-            }
-        }
-        return (path.delete());
-    }
 }



Mime
View raw message