Author: bentmann
Date: Tue Oct 28 14:27:26 2008
New Revision: 708675

URL: http://svn.apache.org/viewvc?rev=708675&view=rev
Log:
o Added new method to wipe out entire groupIds from the local repo to ease test 
preparation

Modified:
    
maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java

Modified: 
maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
URL: 
http://svn.apache.org/viewvc/maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java?rev=708675&r1=708674&r2=708675&view=diff
==============================================================================
--- 
maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
 (original)
+++ 
maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
 Tue Oct 28 14:27:26 2008
@@ -768,6 +768,33 @@
     }
 
     /**
+     * Deletes all artifacts in the specified group id from the local 
repository.
+     * 
+     * @param gid The group id whose artifacts should be deleted, must not be 
<code>null</code>.
+     * @throws IOException If the artifacts could not be deleted.
+     * @since 1.2
+     */
+    public void deleteArtifacts( String gid )
+        throws IOException
+    {
+        String path;
+        if ( "default".equals( localRepoLayout ) )
+        {
+            path = gid.replace( '.', '/' );
+        }
+        else if ( "legacy".equals( localRepoLayout ) )
+        {
+            path = gid;
+        }
+        else
+        {
+            throw new IllegalStateException( "Unsupported repository layout: " 
+ localRepoLayout );
+        }
+
+        FileUtils.deleteDirectory( new File( localRepo, path ) );
+    }
+
+    /**
      * Deletes the specified directory.
      * 
      * @param path The path to the directory to delete, relative to the base 
directory, must not be <code>null</code>.


Reply via email to