1 package org.apache.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.archiva.model.ArtifactReference;
23 import org.apache.archiva.model.RepositoryURL;
24 import org.apache.archiva.repository.layout.LayoutException;
27 * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way,
28 * without the need for processing based on URLs, or working with the database.
32 public interface RemoteRepositoryContent
36 * Convenience method to get the repository id.
40 * Equivalent to calling <code>.getRepository().getId()</code>
43 * @return the repository id.
48 * Get the repository configuration associated with this
51 * @return the repository that is associated with this repository content.
53 RemoteRepository getRepository();
57 * Convenience method to get the repository url.
61 * Equivalent to calling <code>new RepositoryURL( this.getRepository().getUrl() )</code>
64 * @return the repository url.
66 RepositoryURL getURL();
69 * Set the repository configuration to associate with this
72 * @param repo the repository to associate with this repository content.
74 void setRepository( RemoteRepository repo );
77 * Given a repository relative path to a filename, return the {@link org.apache.archiva.model.VersionedReference} object suitable for the path.
79 * @param path the path relative to the repository base dir for the artifact.
80 * @return the {@link ArtifactReference} representing the path. (or null if path cannot be converted to
81 * a {@link ArtifactReference})
82 * @throws LayoutException if there was a problem converting the path to an artifact.
84 ArtifactReference toArtifactReference( String path )
85 throws LayoutException;
88 * Given an ArtifactReference, return the relative path to the artifact.
90 * @param reference the artifact reference to use.
91 * @return the relative path to the artifact.
93 String toPath( ArtifactReference reference );
96 * Given an ArtifactReference, return the url to the artifact.
98 * @param reference the artifact reference to use.
99 * @return the relative path to the artifact.
101 RepositoryURL toURL( ArtifactReference reference );