This project has retired. For details please refer to its Attic page.
RemoteRepositoryContent xref
View Javadoc
1   package org.apache.archiva.repository;
2   
3   /*
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
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
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
19   * under the License.
20   */
21  
22  import org.apache.archiva.admin.model.beans.RemoteRepository;
23  import org.apache.archiva.model.ArtifactReference;
24  import org.apache.archiva.model.RepositoryURL;
25  import org.apache.archiva.repository.layout.LayoutException;
26  
27  /**
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. 
30   *
31   *
32   */
33  public interface RemoteRepositoryContent
34  {
35      /**
36       * <p>
37       * Convenience method to get the repository id.
38       * </p>
39       * 
40       * <p>
41       * Equivalent to calling <code>.getRepository().getId()</code>
42       * </p>
43       * 
44       * @return the repository id.
45       */
46      String getId();
47  
48      /**
49       * Get the repository configuration associated with this
50       * repository content.
51       * 
52       * @return the repository that is associated with this repository content.
53       */
54      RemoteRepository getRepository();
55  
56      /**
57       * <p>
58       * Convenience method to get the repository url.
59       * </p>
60       * 
61       * <p>
62       * Equivalent to calling <code>new RepositoryURL( this.getRepository().getUrl() )</code>
63       * </p>
64       * 
65       * @return the repository url.
66       */
67      RepositoryURL getURL();
68  
69      /**
70       * Set the repository configuration to associate with this
71       * repository content.
72       * 
73       * @param repo the repository to associate with this repository content.
74       */
75      void setRepository( RemoteRepository repo );
76  
77      /**
78       * Given a repository relative path to a filename, return the {@link org.apache.archiva.model.VersionedReference} object suitable for the path.
79       *
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.
84       */
85      ArtifactReference toArtifactReference( String path )
86          throws LayoutException;
87  
88      /**
89       * Given an ArtifactReference, return the relative path to the artifact.
90       *
91       * @param reference the artifact reference to use.
92       * @return the relative path to the artifact.
93       */
94      String toPath( ArtifactReference reference );
95  
96      /**
97       * Given an ArtifactReference, return the url to the artifact.
98       *
99       * @param reference the artifact reference to use.
100      * @return the relative path to the artifact.
101      */
102     RepositoryURL toURL( ArtifactReference reference );
103 }