1 package org.apache.maven.archiva.repository;
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.maven.archiva.configuration.RemoteRepositoryConfiguration;
23 import org.apache.maven.archiva.model.ArtifactReference;
24 import org.apache.maven.archiva.model.RepositoryURL;
25 import org.apache.maven.archiva.repository.layout.LayoutException;
28 * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way,
29 * without the need for processing based on URLs, or working with the database.
33 public interface RemoteRepositoryContent
37 * Convenience method to get the repository id.
41 * Equivalent to calling <code>.getRepository().getId()</code>
44 * @return the repository id.
49 * Get the repository configuration associated with this
52 * @return the repository that is associated with this repository content.
54 RemoteRepositoryConfiguration getRepository();
58 * Convenience method to get the repository url.
62 * Equivalent to calling <code>new RepositoryURL( this.getRepository().getUrl() )</code>
65 * @return the repository url.
67 RepositoryURL getURL();
70 * Set the repository configuration to associate with this
73 * @param repo the repository to associate with this repository content.
75 void setRepository( RemoteRepositoryConfiguration repo );
78 * Given a repository relative path to a filename, return the {@link VersionedReference} object suitable for the path.
80 * @param path the path relative to the repository base dir for the artifact.
81 * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to
82 * a {@link ArtifactReference})
83 * @throws LayoutException if there was a problem converting the path to an artifact.
85 ArtifactReference toArtifactReference( String path )
86 throws LayoutException;
89 * Given an ArtifactReference, return the relative path to the artifact.
91 * @param reference the artifact reference to use.
92 * @return the relative path to the artifact.
94 String toPath( ArtifactReference reference );
97 * Given an ArtifactReference, return the url to the artifact.
99 * @param reference the artifact reference to use.
100 * @return the relative path to the artifact.
102 RepositoryURL toURL( ArtifactReference reference );