]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1361] Add support for NPanday artifact types
authorMaria Odea B. Ching <oching@apache.org>
Tue, 8 Jun 2010 10:00:39 +0000 (10:00 +0000)
committerMaria Odea B. Ching <oching@apache.org>
Tue, 8 Jun 2010 10:00:39 +0000 (10:00 +0000)
patch created & submitted by brett
o add npanday types to artifact extension mapping

git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-1.3.x@952596 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/ArtifactExtensionMapping.java

index d4f70fb8f9ffad51b9262a5cb413efea1e78d560..49aeabac22a32a441e05779f89bccd81f435a80c 100644 (file)
@@ -55,6 +55,20 @@ public class ArtifactExtensionMapping
         typeToExtensionMap.put( MAVEN_PLUGIN, "jar" );
         typeToExtensionMap.put( MAVEN_ONE_PLUGIN, "jar" );
         typeToExtensionMap.put( MAVEN_ARCHETYPE, "jar" );
+
+        // NPanday types
+        typeToExtensionMap.put( "library", "dll" );
+        typeToExtensionMap.put( "asp", "dll" );
+        typeToExtensionMap.put( "gac", "dll" );
+        typeToExtensionMap.put( "gac_generic", "dll" );
+        typeToExtensionMap.put( "gac_msil", "dll" );
+        typeToExtensionMap.put( "gac_32", "dll" );
+        typeToExtensionMap.put( "netplugin", "dll" );
+        typeToExtensionMap.put( "visual-studio-addin", "dll" );
+        typeToExtensionMap.put( "module", "netmodule" );
+        typeToExtensionMap.put( "exe.config", "exe.config" );
+        typeToExtensionMap.put( "winexe", "exe" );
+        typeToExtensionMap.put( "nar", "nar" );
     }
 
     public static String getExtension( String type )
@@ -62,7 +76,7 @@ public class ArtifactExtensionMapping
         // Try specialized types first.
         if ( typeToExtensionMap.containsKey( type ) )
         {
-            return (String) typeToExtensionMap.get( type );
+            return typeToExtensionMap.get( type );
         }
 
         // Return type
@@ -118,6 +132,26 @@ public class ArtifactExtensionMapping
         {
             return "distribution-zip";
         }
+        else if ( "dll".equals( extension ) )
+        {
+            return "library";
+        }
+        else if ( "netmodule".equals( extension ) )
+        {
+            return "module";
+        }
+        else if ( "exe.config".equals( extension ) )
+        {
+            return "exe.config";
+        }
+        else if ( "exe".equals( extension ) )
+        {
+            return "winexe";
+        }
+        else if ( "nar".equals( extension ) )
+        {
+            return "nar";
+        }
         return defaultExtension;
     }
 }