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.ArtifactCleanupFeature;
23import org.apache.archiva.repository.features.IndexCreationFeature;
24import org.apache.archiva.repository.features.StagingRepositoryFeature;
25import org.slf4j.Logger;
26import org.slf4j.LoggerFactory;
2728import java.nio.file.Path;
29import java.util.Locale;
3031/**32 *33 * Just a helper class, mainly used for unit tests.34 *35 *36 */37publicclassBasicManagedRepositoryextendsAbstractManagedRepository3839 {
40 Logger log = LoggerFactory.getLogger(BasicManagedRepository.class);
41ArtifactCleanupFeature artifactCleanupFeature = newArtifactCleanupFeature( );
42StagingRepositoryFeature stagingRepositoryFeature = newStagingRepositoryFeature( );
434445staticfinalStandardCapabilities CAPABILITIES = newStandardCapabilities( new ReleaseScheme[] {
46 ReleaseScheme.RELEASE, ReleaseScheme.SNAPSHOT
47 }, new String[] {"default"}, new String[0], new String[] {
48 ArtifactCleanupFeature.class.toString(), IndexCreationFeature.class.toString(),
49 StagingRepositoryFeature.class.toString()
50 }, true, true, true, true, true );
5152publicBasicManagedRepository( String id, String name, Path basePath )
53 {
54super( RepositoryType.MAVEN, id, name, basePath );
55 initFeatures();
56 }
5758publicBasicManagedRepository( Locale primaryLocale, RepositoryType type, String id, String name, Path basePath )
59 {
60super( primaryLocale, type, id, name, basePath );
61 initFeatures();
62 }
6364privatevoid initFeatures() {
65IndexCreationFeature indexCreationFeature = newIndexCreationFeature(this, this);
66 addFeature( artifactCleanupFeature );
67 addFeature( indexCreationFeature );
68 addFeature( stagingRepositoryFeature );
69 }
7071 @Override
72publicboolean hasIndex( )
73 {
74returntrue;
75 }
7677 @Override
78publicRepositoryCapabilities getCapabilities( )
79 {
80return CAPABILITIES;
81 }
8283 }