]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1151] - Error when processing file nexus-maven-repository-index.zip
authorJevica Arianne B. Zurbano <jzurbano@apache.org>
Tue, 18 Aug 2009 11:41:29 +0000 (11:41 +0000)
committerJevica Arianne B. Zurbano <jzurbano@apache.org>
Tue, 18 Aug 2009 11:41:29 +0000 (11:41 +0000)
applied patch and added unit test.
Submitted by: Gwen Harold Autencio

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@805371 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/FileTypes.java
archiva-modules/archiva-base/archiva-configuration/src/test/java/org/apache/maven/archiva/configuration/FileTypesTest.java

index 94dc9904a005ea27a407e13a6a5c38b72ef452ec..bf043a74faf2e775876512bbee8723a8d16f5643 100644 (file)
@@ -78,7 +78,8 @@ public class FileTypes
      */
     public static final List<String> DEFAULT_EXCLUSIONS = Arrays.asList( "**/maven-metadata.xml",
                                                                           "**/maven-metadata-*.xml", "**/*.sha1",
-                                                                          "**/*.asc", "**/*.md5", "**/*.pgp" );
+                                                                          "**/*.asc", "**/*.md5", "**/*.pgp", 
+                                                                          "**/.index/*.*");
 
     public void setArchivaConfiguration( ArchivaConfiguration archivaConfiguration )
     {
index 6c5df3bf8d901f8a35dfd83ed88dd8639054b1ab..613c86c248e2c7999c075daf5a35fbb91eab8d19 100644 (file)
@@ -52,4 +52,18 @@ public class FileTypesTest
         assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
         assertFalse( filetypes.matchesArtifactPattern( "org/apache/derby/derby/maven-metadata.xml" ) );
     }
+    
+    public void testDefaultExclusions()
+    {
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.gz" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/.index/nexus-maven-repository-index.zip" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.sha1" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz.md5" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.sha1" ) );
+        assertTrue( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/maven-metadata.xml.md5" ) );
+        
+        assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.zip" ) );
+        assertFalse( filetypes.matchesDefaultExclusions( "repository/test/org/apache/derby/derby/10.2.2.0/derby-10.2.2.0-bin.tar.gz" ) );
+    }
 }