001    /*
002     * Copyright 2004 Niclas Hedhman.
003     * Copyright 2005 Stephen McConnell
004     *
005     * Licensed  under the  Apache License,  Version 2.0  (the "License");
006     * you may not use  this file  except in  compliance with the License.
007     * You may obtain a copy of the License at
008     *
009     *   http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed  under the  License is distributed on an "AS IS" BASIS,
013     * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
014     * implied.
015     *
016     * See the License for the specific language governing permissions and
017     * limitations under the License.
018     */
019    
020    package net.dpml.transit;
021    
022    /** 
023     * A Layout abstracts the decoding process of the location
024     * of artifacts in various filesystems.
025     *
026     * @author <a href="http://www.dpml.net">Digital Product Meta Library</a>
027     * @version 1.0.3
028     */
029    public interface Layout
030    {
031        /**
032         * Return the base path for an artifact.  The base path is the location
033         * where the file will be found. The base + "/" filename is equal to the
034         * full path.
035         *
036         * @param artifact the Artifact to resolve.
037         * @return the base path
038         */
039        String resolveBase( Artifact artifact );
040    
041        /**
042         * Returns the full path of the artifact relative to a logical root directory.
043         * The base + "/" filename is equal to the full path.
044         *
045         * @see #resolveBase
046         * @see #resolveFilename
047         * @param artifact the Artifact to resolve.
048         * @return the logical artifact path
049         */
050        String resolvePath( Artifact artifact );
051    
052        /**
053         * Return the filename for an artifact.  The base + "/" filename is equal
054         * to the full path.
055         *
056         * @see #resolveBase
057         * @see #resolveFilename
058         * @param artifact the Artifact to resolve.
059         * @return the logical artifact path
060         */
061        String resolveFilename( Artifact artifact );
062    }