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;
23 import org.springframework.stereotype.Service;
25 import java.util.HashMap;
30 @Service( "artifactMappingProvider#npanday" )
31 public class NPandayArtifactMappingProvider
32 implements ArtifactMappingProvider
34 private final Map<String, String> classifierAndExtensionToTypeMap;
36 private final Map<String, String> typeToExtensionMap;
38 public NPandayArtifactMappingProvider()
40 classifierAndExtensionToTypeMap = new HashMap<String, String>();
42 // TODO: this could be one of many - we need to look up the artifact metadata from the POM instead
43 // should do this anyway so that plugins don't compete for providing an extension
44 classifierAndExtensionToTypeMap.put( "dll", "library" );
46 classifierAndExtensionToTypeMap.put( "netmodule", "module" );
47 classifierAndExtensionToTypeMap.put( "exe", "winexe" );
48 classifierAndExtensionToTypeMap.put( "tests:jar", "test-jar" );
50 typeToExtensionMap = new HashMap<String, String>();
51 typeToExtensionMap.put( "library", "dll" );
52 typeToExtensionMap.put( "asp", "dll" );
53 typeToExtensionMap.put( "gac", "dll" );
54 typeToExtensionMap.put( "gac_generic", "dll" );
55 typeToExtensionMap.put( "gac_msil", "dll" );
56 typeToExtensionMap.put( "gac_32", "dll" );
57 typeToExtensionMap.put( "netplugin", "dll" );
58 typeToExtensionMap.put( "visual-studio-addin", "dll" );
59 typeToExtensionMap.put( "module", "netmodule" );
60 typeToExtensionMap.put( "exe.config", "exe.config" );
61 typeToExtensionMap.put( "winexe", "exe" );
62 typeToExtensionMap.put( "nar", "nar" );
65 public String mapClassifierAndExtensionToType( String classifier, String ext )
67 // we don't need classifier
68 return classifierAndExtensionToTypeMap.get( ext );
71 public String mapTypeToExtension( String type )
73 return typeToExtensionMap.get( type );