net.dpml.transit
Class ClassicLayout

java.lang.Object
  extended bynet.dpml.transit.ClassicLayout
All Implemented Interfaces:
Layout

public class ClassicLayout
extends Object
implements Layout

The ClassicLayout decodes artifacts into the Classic/Maven layout of artifacts on a file system or http server. This format says that for an artifact artifact:[type]:[group]/[name]#[version] the location of such artifact would be; [group]/[type]s/[name]-[version].[type]. Example; artifact:jar:metro/cache/dpml-cache-main#1.0.0 would return the path metro/cache/jars/dpml-cache-main-1.0.0.jar.

Version:
1.0.1
Author:
Digital Product Meta Library

Constructor Summary
ClassicLayout()
           
 
Method Summary
 String resolveBase(Artifact artifact)
          Return the base path for an artifact.
 String resolveFilename(Artifact artifact)
          Return the expanded filename of the artifact.
 String resolvePath(Artifact artifact)
          Returns the full path of the artifact relative to a logical root directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassicLayout

public ClassicLayout()
Method Detail

resolveBase

public final String resolveBase(Artifact artifact)
Return the base path for an artifact. The base path is derived from the artifact group and type. For an artifact group of "metro/cache" and a type equal to "jar", the base value will be translated using the pattern "[group]/[type]s" to form "metro/cache/jars". The base path value represents the directory path relative to a repository root of the directory containing this artifact.

Specified by:
resolveBase in interface Layout
Parameters:
artifact - the resource artifact
Returns:
the base path

resolvePath

public final String resolvePath(Artifact artifact)
Returns the full path of the artifact relative to a logical root directory. The full path is equivalent to the base path and artifact filename using the pattern "[base]/[filename]". Path values may be used to resolve an artifact from a remote repository or local cache relative to the repository or cache root. An artifact such as artifact:jar:metro/cache/dpml-cache-main#1.0.0 would return the path metro/cache/jars/dpml-cache-main-1.0.0.jar.

Specified by:
resolvePath in interface Layout
Parameters:
artifact - the resource artifact
Returns:
the logical artifact path
See Also:
resolveBase(net.dpml.transit.Artifact), resolveFilename(net.dpml.transit.Artifact)

resolveFilename

public String resolveFilename(Artifact artifact)
Return the expanded filename of the artifact. The filename is expressed as [name]-[version].[type] or in case of a null version simply [name].[type].

Specified by:
resolveFilename in interface Layout
Parameters:
artifact - the resource artifact
Returns:
the artifact expanded filename
See Also:
Layout.resolveBase(net.dpml.transit.Artifact), Layout.resolveFilename(net.dpml.transit.Artifact)