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.ContentNotFoundException;
27 import org.apache.archiva.repository.LayoutException;
28 import org.apache.archiva.repository.ManagedRepository;
29 import org.apache.archiva.repository.ManagedRepositoryContent;
30 import org.apache.archiva.repository.RepositoryException;
31 import org.apache.archiva.repository.content.StorageAsset;
32 import org.springframework.stereotype.Service;
37 * @author Martin Stockhammer <martin_s@apache.org>
39 @Service("managedRepositoryContent#mock")
40 public class ManagedRepositoryContentMock implements ManagedRepositoryContent
42 private ManagedRepository repository;
45 public void deleteVersion( VersionedReference reference ) throws ContentNotFoundException
51 public void deleteArtifact( ArtifactReference artifactReference ) throws ContentNotFoundException
57 public void deleteGroupId( String groupId ) throws ContentNotFoundException
63 public void deleteProject( String namespace, String projectId ) throws RepositoryException
69 public String getId( )
75 public Set<ArtifactReference> getRelatedArtifacts( ArtifactReference reference ) throws ContentNotFoundException
81 public String getRepoRoot( )
87 public ManagedRepository getRepository( )
93 public Set<String> getVersions( ProjectReference reference ) throws ContentNotFoundException, LayoutException
99 public Set<String> getVersions( VersionedReference reference ) throws ContentNotFoundException
105 public boolean hasContent( ArtifactReference reference )
111 public boolean hasContent( ProjectReference reference )
117 public boolean hasContent( VersionedReference reference )
123 public void setRepository( ManagedRepository repo )
125 this.repository = repo;
129 public ArtifactReference toArtifactReference( String path ) throws LayoutException
135 public StorageAsset toFile( ArtifactReference reference )
141 public StorageAsset toFile( ArchivaArtifact reference )
147 public String toMetadataPath( ProjectReference reference )
153 public String toMetadataPath( VersionedReference reference )
159 public String toPath( ArtifactReference reference )
165 public String toPath( ArchivaArtifact reference )