archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r640823 - in /maven/archiva/trunk/archiva-base/archiva-repository-layer/src: main/java/org/apache/maven/archiva/repository/content/ test/java/org/apache/maven/archiva/repository/content/
Date Tue, 25 Mar 2008 14:08:19 GMT
Author: brett
Date: Tue Mar 25 07:08:17 2008
New Revision: 640823

URL: http://svn.apache.org/viewvc?rev=640823&view=rev
Log:
[MRM-664] Cannot download a strut-module artifact in a Legacy repository
- there seemed to be no reason to rename type from . to - apart from cosmetics so this was
changed to allow - in extensions
Merged from: r640811

Modified:
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java?rev=640823&r1=640822&r2=640823&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java
Tue Mar 25 07:08:17 2008
@@ -64,7 +64,7 @@
         }
 
         // Return type
-        return type.replace( '-', '.' );
+        return type;
     }
 
     /**

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java?rev=640823&r1=640822&r2=640823&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/DefaultPathParser.java
Tue Mar 25 07:08:17 2008
@@ -152,7 +152,7 @@
                 case '.':
                     // We have an dual extension possibility.
                     String extension = parser.remaining() + '.' + parser.getExtension();
-                    artifact.setType( extension.replace( '.', '-' ) );
+                    artifact.setType( extension );
                     break;
                 case 0:
                     // End of the filename, only a simple extension left. - Set the type.

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java?rev=640823&r1=640822&r2=640823&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/FilenameParser.java
Tue Mar 25 07:08:17 2008
@@ -41,7 +41,7 @@
     private static final Pattern mavenPluginPattern = Pattern.compile( "(maven-.*-plugin)|(.*-maven-plugin)"
);
 
     private static final Pattern extensionPattern =
-        Pattern.compile( "(\\.tar\\.gz$)|(\\.tar\\.bz2$)|(\\.[a-z0-9]*$)", Pattern.CASE_INSENSITIVE
);
+        Pattern.compile( "(\\.tar\\.gz$)|(\\.tar\\.bz2$)|(\\.[\\-a-z0-9]*$)", Pattern.CASE_INSENSITIVE
);
 
     private static final Pattern SNAPSHOT_PATTERN = Pattern.compile( "^([0-9]{8}\\.[0-9]{6}-[0-9]+)(.*)$"
);
 

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java?rev=640823&r1=640822&r2=640823&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/DefaultPathParserTest.java
Tue Mar 25 07:08:17 2008
@@ -82,7 +82,7 @@
         String artifactId = "example-presentation";
         String version = "3.2";
         String classifier = null;
-        String type = "xml-zip";
+        String type = "xml.zip";
         String path = "org/project/example-presentation/3.2/example-presentation-3.2.xml.zip";
 
         assertLayout( path, groupId, artifactId, version, classifier, type );

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java?rev=640823&r1=640822&r2=640823&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
(original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
Tue Mar 25 07:08:17 2008
@@ -358,6 +358,16 @@
                       repoRequest.toNativePath( "mygroup/ejbs/myejb-1.0.jar", repository
) );
     }
 
+    public void testNativePathPomLegacyToLegacyStrutsModule()
+        throws Exception
+    {
+        ManagedRepositoryContent repository = createManagedRepo( "legacy" );
+
+        // Test (pom) legacy to default
+        assertEquals( "WebPortal/struts-modules/eventsDB-1.2.3.struts-module",
+                      repoRequest.toNativePath( "WebPortal/struts-modules/eventsDB-1.2.3.struts-module",
repository ) );
+    }
+
     public void testNativePathSupportFileLegacyToDefault()
         throws Exception
     {



Mime
View raw message