maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r498462 - /maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
Date Sun, 21 Jan 2007 21:38:22 GMT
Author: jvanzyl
Date: Sun Jan 21 13:38:21 2007
New Revision: 498462

URL: http://svn.apache.org/viewvc?view=rev&rev=498462
Log:
o nuke the checkout directory when the connection closes. it now actually works for a release.


Modified:
    maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java

Modified: maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
URL: http://svn.apache.org/viewvc/maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java?view=diff&rev=498462&r1=498461&r2=498462
==============================================================================
--- maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
(original)
+++ maven/sandbox/wagon/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java
Sun Jan 21 13:38:21 2007
@@ -58,6 +58,7 @@
  * @author <a href="brett@apache.org">Brett Porter</a>
  * @author <a href="evenisse@apache.org">Emmanuel Venisse</a>
  * @author <a href="carlos@apache.org">Carlos Sanchez</a>
+ * @author Jason van Zyl
  * @version $Id$
  */
 public class ScmWagon
@@ -131,15 +132,9 @@
 
         if ( checkoutDirectory.exists() )
         {
-            try
-            {
-                FileUtils.deleteDirectory( checkoutDirectory );
-            }
-            catch ( IOException e )
-            {
-                throw new ConnectionException( "Unable to cleanup checkout directory", e
);
-            }
+            removeCheckoutDirectory();
         }
+
         checkoutDirectory.mkdirs();
     }
 
@@ -164,6 +159,20 @@
         return checkoutDirectory;
     }
 
+
+    private void removeCheckoutDirectory()
+        throws ConnectionException
+    {
+        try
+        {
+            FileUtils.deleteDirectory( checkoutDirectory );
+        }
+        catch ( IOException e )
+        {
+            throw new ConnectionException( "Unable to cleanup checkout directory", e );
+        }        
+    }
+
     private ScmRepository getScmRepository( String url )
         throws TransferFailedException
     {
@@ -503,7 +512,9 @@
     }
 
     public void closeConnection()
+        throws ConnectionException
     {
+        removeCheckoutDirectory();
     }
 
     /**



Mime
View raw message