1 package org.apache.maven.archiva.repository.content;
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.repository.ArchivaArtifact;
25 * BidirectionalRepositoryLayout - Similar in scope to ArtifactRepositoryLayout, but does
26 * the both the Path to Artifact, and Artifact to Path conversions.
28 * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
31 public interface BidirectionalRepositoryLayout
34 * Get the identifier for this layout.
36 * @return the identifier for this layout.
38 public String getId();
41 * Given an ArchivaArtifact, return the relative path to the artifact.
43 * @param artifact the artifact to compute the path of.
44 * @return the relative path to the artifact.
46 public String pathOf( ArchivaArtifact artifact );
49 * Given a repository relative path to a filename, return the ArchivaArtifact object suitable for the path.
51 * @param path the path relative to the repository base dir for the artifact.
52 * @return the ArchivaArtifact representing the path. (or null if path cannot be converted to an ArchivaArtifact)
54 ArchivaArtifact toArtifact( String path );