net.dpml.transit
Class ModernLayout

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

public class ModernLayout
extends Object
implements Layout

The ModernLayout decodes artifacts into a layout scheme that follows the convention of group/name/version/expanded-name pattern. Specifically the layout maps artifacts according to the rule [group[/[subgroup[/...]]]/[name]/[version]/name[-[version]].type. Example: artifact:jar:metro/cache/dpml-cache-main#1.0.0 would return the path metro/cache/dpml-cache-main/1.0.0/dpml-cache-main-1.0.0.jar.

Version:
1.0.1
Author:
Digital Product Meta Library

Constructor Summary
ModernLayout()
           
 
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

ModernLayout

public ModernLayout()
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. 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.

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)