1 package org.apache.archiva.plugins.npanday;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider;
24 import java.util.HashMap;
28 * @plexus.component role="org.apache.archiva.metadata.repository.storage.maven2.ArtifactMappingProvider" role-hint="npanday"
30 public class NPandayArtifactMappingProvider
31 implements ArtifactMappingProvider
33 private final Map<String, String> classifierAndExtensionToTypeMap;
35 private final Map<String, String> typeToExtensionMap;
37 public NPandayArtifactMappingProvider()
39 classifierAndExtensionToTypeMap = new HashMap<String, String>();
41 // TODO: this could be one of many - we need to look up the artifact metadata from the POM instead
42 // should do this anyway so that plugins don't compete for providing an extension
43 classifierAndExtensionToTypeMap.put( "dll", "library" );
45 classifierAndExtensionToTypeMap.put( "netmodule", "module" );
46 classifierAndExtensionToTypeMap.put( "exe", "winexe" );
47 classifierAndExtensionToTypeMap.put( "tests:jar", "test-jar" );
49 typeToExtensionMap = new HashMap<String, String>();
50 typeToExtensionMap.put( "library", "dll" );
51 typeToExtensionMap.put( "asp", "dll" );
52 typeToExtensionMap.put( "gac", "dll" );
53 typeToExtensionMap.put( "gac_generic", "dll" );
54 typeToExtensionMap.put( "gac_msil", "dll" );
55 typeToExtensionMap.put( "gac_32", "dll" );
56 typeToExtensionMap.put( "netplugin", "dll" );
57 typeToExtensionMap.put( "visual-studio-addin", "dll" );
58 typeToExtensionMap.put( "module", "netmodule" );
59 typeToExtensionMap.put( "exe.config", "exe.config" );
60 typeToExtensionMap.put( "winexe", "exe" );
61 typeToExtensionMap.put( "nar", "nar" );
64 public String mapClassifierAndExtensionToType( String classifier, String ext )
66 // we don't need classifier
67 return classifierAndExtensionToTypeMap.get( ext );
70 public String mapTypeToExtension( String type )
72 return typeToExtensionMap.get( type );