net.dpml.transit.layout
Class EclipseLayout

java.lang.Object
  extended by net.dpml.transit.Layout
      extended by net.dpml.transit.layout.EclipseLayout

public class EclipseLayout
extends Layout

The EclipseLayout decodes artifacts into the Eclipse specified 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]-[version]/[name].[type]. Example; artifact:jar:eclipse/plugins/eclipse-osgi-runtime/core#3.1.0 would return the path eclipse/plugins/eclipse-osgi-runtime-3.1.0/core.jar.

Version:
2.0.1
Author:
Digital Product Management Laboratory

Constructor Summary
EclipseLayout()
           
 
Method Summary
 boolean equals(Object other)
          Compare this object with another for equality.
 String getID()
          Return the layout identifier.
 int hashCode()
          Compare the object hash code.
 String resolveBase(Artifact artifact)
          Return the base path for an artifact.
 String resolveBaseFilename(Artifact artifact)
          Return the expanded filename of the 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 net.dpml.transit.Layout
getLayout
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseLayout

public EclipseLayout()
Method Detail

getID

public String getID()
Return the layout identifier. The id value is used to identify layout instances assigned to cache handlers and resource host handlers.

Specified by:
getID in class Layout
Returns:
the layout id

resolveBase

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

Specified by:
resolveBase in class Layout
Parameters:
artifact - the artifact to resolve the base path from
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:eclipse/plugins/eclipse-osgi-runtime/core#3.1.0 would return the path eclipse/plugins/eclipse-osgi-runtime-3.1.0/core.jar.

Specified by:
resolvePath in class Layout
Parameters:
artifact - the artifact to resolve the path from
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].[type].

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

resolveBaseFilename

public String resolveBaseFilename(Artifact artifact)
Return the expanded filename of the artifact. The filename is expressed as [name].[type].

Parameters:
artifact - the artifact to resolve
Returns:
the artifact expanded filename

equals

public boolean equals(Object other)
Compare this object with another for equality.

Overrides:
equals in class Object
Parameters:
other - the object to compare with this object
Returns:
true if the objects are equal

hashCode

public int hashCode()
Compare the object hash code.

Overrides:
hashCode in class Object
Returns:
the hash value