1package org.apache.archiva.repository;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import org.apache.archiva.repository.features.IndexCreationFeature;
23import org.apache.archiva.repository.features.RemoteIndexFeature;
24import org.slf4j.Logger;
25import org.slf4j.LoggerFactory;
2627import java.nio.file.Path;
28import java.util.Locale;
2930/**31 *32 * Just a helper class, mainly used for unit tests.33 *34 *35 */36publicclassBasicRemoteRepositoryextendsAbstractRemoteRepository3738 {
39 Logger log = LoggerFactory.getLogger(BasicRemoteRepository.class);
4041RemoteIndexFeature remoteIndexFeature = newRemoteIndexFeature();
42IndexCreationFeature indexCreationFeature = newIndexCreationFeature(true);
434445staticfinalStandardCapabilities CAPABILITIES = newStandardCapabilities( new ReleaseScheme[] {
46 ReleaseScheme.RELEASE, ReleaseScheme.SNAPSHOT
47 }, new String[] {"default"}, new String[0], new String[] {
48 RemoteIndexFeature.class.toString(),
49 IndexCreationFeature.class.toString()
50 }, true, true, true, true, true );
5152publicBasicRemoteRepository( String id, String name, Path basePath )
53 {
54super( RepositoryType.MAVEN, id, name, basePath);
55 initFeatures();
56 }
5758publicBasicRemoteRepository( Locale primaryLocale, RepositoryType type, String id, String name, Path basePath )
59 {
60super( primaryLocale, type, id, name, basePath );
61 initFeatures();
62 }
6364privatevoid initFeatures() {
65 addFeature( remoteIndexFeature );
66 addFeature( indexCreationFeature );
67 }
6869 @Override
70publicboolean hasIndex( )
71 {
72returntrue;
73 }
7475 @Override
76publicRepositoryCapabilities getCapabilities( )
77 {
78return CAPABILITIES;
79 }
808182 }