1 package org.apache.archiva.repository.mock;
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.model.ArchivaArtifact;
23 import org.apache.archiva.model.ArtifactReference;
24 import org.apache.archiva.model.ProjectReference;
25 import org.apache.archiva.model.VersionedReference;
26 import org.apache.archiva.repository.ContentAccessException;
27 import org.apache.archiva.repository.ContentNotFoundException;
28 import org.apache.archiva.repository.LayoutException;
29 import org.apache.archiva.repository.ManagedRepository;
30 import org.apache.archiva.repository.ManagedRepositoryContent;
31 import org.apache.archiva.repository.storage.StorageAsset;
32 import org.springframework.stereotype.Service;
34 import java.util.List;
38 * @author Martin Stockhammer <martin_s@apache.org>
40 @Service("managedRepositoryContent#mock")
41 public class ManagedRepositoryContentMock implements ManagedRepositoryContent
43 private ManagedRepository repository;
46 public VersionedReference toVersion( String groupId, String artifactId, String version )
52 public VersionedReference toGenericVersion( ArtifactReference artifactReference )
58 public VersionedReference toVersion( ArtifactReference artifactReference )
64 public ArtifactReference toArtifact( String groupId, String artifactId, String version, String type, String classifier )
70 public void deleteVersion( VersionedReference reference ) throws ContentNotFoundException, ContentAccessException
76 public void deleteArtifact( ArtifactReference artifactReference ) throws ContentNotFoundException, ContentAccessException
82 public void deleteGroupId( String groupId ) throws ContentNotFoundException, ContentAccessException
88 public void deleteProject( String namespace, String projectId ) throws ContentNotFoundException, ContentAccessException
94 public void deleteProject( ProjectReference reference ) throws ContentNotFoundException, ContentAccessException
100 public String getId( )
106 public List<ArtifactReference> getRelatedArtifacts( ArtifactReference reference ) throws ContentNotFoundException, LayoutException, ContentAccessException
112 public List<ArtifactReference> getRelatedArtifacts( VersionedReference reference ) throws ContentNotFoundException, LayoutException, ContentAccessException
118 public List<StorageAsset> getRelatedAssets( ArtifactReference reference ) throws ContentNotFoundException, LayoutException, ContentAccessException
124 public List<ArtifactReference> getArtifacts( VersionedReference reference ) throws ContentNotFoundException, LayoutException, ContentAccessException
130 public String getRepoRoot( )
136 public ManagedRepository getRepository( )
142 public Set<String> getVersions( ProjectReference reference ) throws ContentNotFoundException, LayoutException, ContentAccessException
148 public Set<String> getVersions( VersionedReference reference ) throws ContentNotFoundException, ContentAccessException, LayoutException
154 public boolean hasContent( ArtifactReference reference ) throws ContentAccessException
160 public boolean hasContent( ProjectReference reference ) throws ContentAccessException
166 public boolean hasContent( VersionedReference reference ) throws ContentAccessException
172 public void setRepository( ManagedRepository repo )
174 this.repository = repo;
178 public StorageAsset toFile( VersionedReference reference )
184 public ArtifactReference toArtifactReference( String path ) throws LayoutException
190 public StorageAsset toFile( ArtifactReference reference )
196 public StorageAsset toFile( ArchivaArtifact reference )
202 public String toMetadataPath( ProjectReference reference )
208 public String toMetadataPath( VersionedReference reference )
214 public String toPath( ArtifactReference reference )
220 public String toPath( ArchivaArtifact reference )