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.model.ArtifactReference; 23 import org.apache.archiva.model.RepositoryURL; 24 25 /** 26 * RemoteRepositoryContent interface for interacting with a remote repository in an abstract way, 27 * without the need for processing based on URLs, or working with the database. 28 * 29 * 30 */ 31 public interface RemoteRepositoryContent extends RepositoryContent 32 { 33 /** 34 * <p> 35 * Convenience method to get the repository id. 36 * </p> 37 * 38 * <p> 39 * Equivalent to calling <code>.getRepository().getId()</code> 40 * </p> 41 * 42 * @return the repository id. 43 */ 44 String getId(); 45 46 /** 47 * Get the repository configuration associated with this 48 * repository content. 49 * 50 * @return the repository that is associated with this repository content. 51 */ 52 RemoteRepository getRepository(); 53 54 /** 55 * <p> 56 * Convenience method to get the repository url. 57 * </p> 58 * 59 * <p> 60 * Equivalent to calling <code>new RepositoryURL( this.getRepository().getUrl() )</code> 61 * </p> 62 * 63 * @return the repository url. 64 */ 65 RepositoryURL getURL(); 66 67 /** 68 * Set the repository configuration to associate with this 69 * repository content. 70 * 71 * @param repo the repository to associate with this repository content. 72 */ 73 void setRepository( RemoteRepository repo ); 74 75 /** 76 * Given an ArtifactReference, return the url to the artifact. 77 * 78 * @param reference the artifact reference to use. 79 * @return the relative path to the artifact. 80 */ 81 RepositoryURL toURL( ArtifactReference reference ); 82 }