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> extensionToTypeMap;
36 private final Map<String, String> typeToExtensionMap;
38 public NPandayArtifactMappingProvider()
40 extensionToTypeMap = new HashMap<>();
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 extensionToTypeMap.put( "dll", "dotnet-library" );
46 extensionToTypeMap.put( "netmodule", "dotnet-module" );
47 extensionToTypeMap.put( "exe", "dotnet-executable" );
49 typeToExtensionMap = new HashMap<>();
50 typeToExtensionMap.put( "dotnet-library", "dll" );
51 typeToExtensionMap.put( "dotnet-library-config", "dll.config" );
52 typeToExtensionMap.put( "dotnet-executable", "exe" );
53 typeToExtensionMap.put( "dotnet-executable-config", "exe.config" );
54 typeToExtensionMap.put( "dotnet-module", "netmodule" );
55 typeToExtensionMap.put( "dotnet-maven-plugin", "dll" );
56 typeToExtensionMap.put( "asp", "dll" );
57 typeToExtensionMap.put( "visual-studio-addin", "dll" );
58 typeToExtensionMap.put( "sharp-develop-addin", "dll" );
59 typeToExtensionMap.put( "nar", "nar" );
60 typeToExtensionMap.put( "dotnet-symbols", "pdb" );
61 typeToExtensionMap.put( "ole-type-library", "tlb" );
62 typeToExtensionMap.put( "dotnet-vsdocs", "xml" );
63 typeToExtensionMap.put( "dotnet-archive", "zip" );
64 typeToExtensionMap.put( "dotnet-gac", "dll" );
65 typeToExtensionMap.put( "gac", "dll" );
66 typeToExtensionMap.put( "gac_msil", "dll" );
67 typeToExtensionMap.put( "gac_msil4", "dll" );
68 typeToExtensionMap.put( "gac_32", "dll" );
69 typeToExtensionMap.put( "gac_32_4", "dll" );
70 typeToExtensionMap.put( "gac_64", "dll" );
71 typeToExtensionMap.put( "gac_64_4", "dll" );
72 typeToExtensionMap.put( "com_reference", "dll" );
75 typeToExtensionMap.put( "library", "dll" );
76 typeToExtensionMap.put( "gac_generic", "dll" );
77 typeToExtensionMap.put( "netplugin", "dll" );
78 typeToExtensionMap.put( "module", "netmodule" );
79 typeToExtensionMap.put( "exe.config", "exe.config" );
80 typeToExtensionMap.put( "winexe", "exe" );
81 typeToExtensionMap.put( "exe", "exe" );
85 public String mapClassifierAndExtensionToType( String classifier, String ext )
87 // we don't need classifier
88 return extensionToTypeMap.get( ext );
92 public String mapTypeToExtension( String type )
94 return typeToExtensionMap.get( type );