org.apache.avalon.repository
Class Artifact

java.lang.Object
  extended byorg.apache.avalon.repository.Artifact
All Implemented Interfaces:
Serializable

public class Artifact
extends Object
implements Serializable

Defintion of a artifact that maintains a relative url to some nominally remote file together with a set of assigned properties.

Version:
$Revision: 1.2 $
Author:
Stephen McConnell
See Also:
Serialized Form

Field Summary
static String GROUP_KEY
           
static String NAME_KEY
           
static String SEP
           
static String TYPE_KEY
           
static String VERSION_KEY
           
 
Method Summary
static Artifact createArtifact(String spec)
           
static Artifact createArtifact(String group, String name, String version)
           
static Artifact createArtifact(String group, String name, String version, String type)
           
 String getBase()
          Return the base path to the artifact.
 String getFilename()
          Return the filename of the artifact.
 String getGroup()
          Return the group identifier for this artifact.
 String getName()
          Return the name of this artifact.
 String getPath()
          Gets the artifact path.
 String getSpecification()
          Gets the artifact specification for this Artifact in the form [:][;].
 String getType()
          Return the artifact type.
 String getURL()
          Gets the relative artifact URL.
 String getURL(String host)
          Gets the URL to the artifact given a base URL for a remote repository.
 String getVersion()
          Return the artifact version.
 String toString()
          Return a stringified representation of the instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEP

public static final String SEP
See Also:
Constant Field Values

GROUP_KEY

public static final String GROUP_KEY
See Also:
Constant Field Values

NAME_KEY

public static final String NAME_KEY
See Also:
Constant Field Values

VERSION_KEY

public static final String VERSION_KEY
See Also:
Constant Field Values

TYPE_KEY

public static final String TYPE_KEY
See Also:
Constant Field Values
Method Detail

createArtifact

public static Artifact createArtifact(String spec)

createArtifact

public static Artifact createArtifact(String group,
                                      String name,
                                      String version)

createArtifact

public static Artifact createArtifact(String group,
                                      String name,
                                      String version,
                                      String type)

getURL

public String getURL()
Gets the relative artifact URL.

Returns:
the relative url

getURL

public String getURL(String host)
Gets the URL to the artifact given a base URL for a remote repository.

Parameters:
host - the base repository URL
Returns:
the full URL to the artifact

getGroup

public String getGroup()
Return the group identifier for this artifact.

Returns:
the group

getName

public String getName()
Return the name of this artifact.

Returns:
the name

getType

public String getType()
Return the artifact type.

Returns:
the type

getVersion

public String getVersion()
Return the artifact version.

Returns:
the version

getSpecification

public String getSpecification()
Gets the artifact specification for this Artifact in the form [:][;].

Returns:
the artifact specification

getBase

public String getBase()
Return the base path to the artifact. This is equivelent to the a logic directory path without a leading or trailing seperator.

Returns:
the base path.

getFilename

public String getFilename()
Return the filename of the artifact.

Returns:
the name.

getPath

public String getPath()
Gets the artifact path. The value returned is equal to the base path, seperator and filename.

Returns:
the artifact path

toString

public String toString()
Return a stringified representation of the instance.

Returns:
the string representation


Copyright © Apache Software Foundation. All Rights Reserved.