1 package org.apache.archiva.repository.maven2;
3 import org.apache.archiva.repository.AbstractRemoteRepository;
4 import org.apache.archiva.repository.ReleaseScheme;
5 import org.apache.archiva.repository.RemoteRepository;
6 import org.apache.archiva.repository.RepositoryCapabilities;
7 import org.apache.archiva.repository.RepositoryType;
8 import org.apache.archiva.repository.StandardCapabilities;
9 import org.apache.archiva.repository.UnsupportedFeatureException;
10 import org.apache.archiva.repository.features.ArtifactCleanupFeature;
11 import org.apache.archiva.repository.features.IndexCreationFeature;
12 import org.apache.archiva.repository.features.RemoteIndexFeature;
13 import org.apache.archiva.repository.features.RepositoryFeature;
14 import org.apache.archiva.repository.features.StagingRepositoryFeature;
16 import java.util.Locale;
19 * Licensed to the Apache Software Foundation (ASF) under one
20 * or more contributor license agreements. See the NOTICE file
21 * distributed with this work for additional information
22 * regarding copyright ownership. The ASF licenses this file
23 * to you under the Apache License, Version 2.0 (the
24 * "License"); you may not use this file except in compliance
25 * with the License. You may obtain a copy of the License at
27 * http://www.apache.org/licenses/LICENSE-2.0
29 * Unless required by applicable law or agreed to in writing,
30 * software distributed under the License is distributed on an
31 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
32 * KIND, either express or implied. See the License for the
33 * specific language governing permissions and limitations
38 * Maven2 remote repository implementation
40 public class MavenRemoteRepository extends AbstractRemoteRepository
41 implements RemoteRepository
43 private RemoteIndexFeature remoteIndexFeature = new RemoteIndexFeature();
45 private static final RepositoryCapabilities CAPABILITIES = new StandardCapabilities(
46 new ReleaseScheme[] { ReleaseScheme.RELEASE, ReleaseScheme.SNAPSHOT },
47 new String[] { MavenManagedRepository.DEFAULT_LAYOUT, MavenManagedRepository.LEGACY_LAYOUT},
49 new String[] {RemoteIndexFeature.class.getName()},
57 public MavenRemoteRepository( String id, String name )
59 super( RepositoryType.MAVEN, id, name );
62 public MavenRemoteRepository( Locale primaryLocale, String id, String name )
64 super( primaryLocale, RepositoryType.MAVEN, id, name );
68 public RepositoryCapabilities getCapabilities( )
74 public <T extends RepositoryFeature<T>> RepositoryFeature<T> getFeature( Class<T> clazz ) throws UnsupportedFeatureException
76 if (RemoteIndexFeature.class.equals( clazz )) {
77 return (RepositoryFeature<T>) remoteIndexFeature;
79 throw new UnsupportedFeatureException( );
84 public <T extends RepositoryFeature<T>> boolean supportsFeature( Class<T> clazz )
86 if ( RemoteIndexFeature.class.equals(clazz)) {