org.apache.maven.repository
Class AbstractArtifact

java.lang.Object
  extended byorg.apache.maven.repository.AbstractArtifact
All Implemented Interfaces:
Artifact
Direct Known Subclasses:
GenericArtifact, PluginArtifact

public abstract class AbstractArtifact
extends java.lang.Object
implements Artifact

Base class from which all artifact subclasses are derived.

Author:
Jason van Zyl

Field Summary
protected static java.lang.String fs
          Platform specific file separator used for file system operations.
 
Fields inherited from interface org.apache.maven.repository.Artifact
OVERRIDE_NONE, OVERRIDE_PATH, OVERRIDE_VERSION
 
Constructor Summary
AbstractArtifact(org.apache.maven.project.Dependency dependency)
          Default constructor.
 
Method Summary
 boolean exists()
          Boolean flag indicating whether this artifact exists.
 java.lang.String generatePath()
          Generate the path for this artifact given its dependency attributes.
 java.lang.String getChecksumUrl()
          Return the url to the checksum file for this artifact.
 org.apache.maven.project.Dependency getDependency()
          Get the dependency.
 java.lang.String getDescription()
           
 java.io.File getFile()
          Get the location of the artifact in the local file system.
 java.lang.String getName()
          Get the name of the artifact from the underlying dependency.
 java.lang.String getOverrideType()
           
 java.lang.String getPath()
          Return the path of the artifact using platform specific naming conventions.
 java.lang.String getUrlPath()
          Return an URL path that is platform agnostic.
 boolean isSnapshot()
          Boolean flag indicating whether this artifact is a snapshot.
 void setDependency(org.apache.maven.project.Dependency dependency)
          Set the dependency for this JAR artifact.
 void setOverrideType(java.lang.String overrideType)
           
 void setPath(java.lang.String repositoryPath)
          Set the path to the artifact.
 void verify()
          C H E C K S U M V E R I F I C A T I O N
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fs

protected static final java.lang.String fs
Platform specific file separator used for file system operations.

Constructor Detail

AbstractArtifact

public AbstractArtifact(org.apache.maven.project.Dependency dependency)
Default constructor.

Parameters:
dependency - the dependency the artifact is based on
Method Detail

setDependency

public void setDependency(org.apache.maven.project.Dependency dependency)
Description copied from interface: Artifact
Set the dependency for this JAR artifact.

Specified by:
setDependency in interface Artifact
Parameters:
dependency - Dependency this artifact is based on.
See Also:
Artifact.setDependency(org.apache.maven.project.Dependency)

getDependency

public org.apache.maven.project.Dependency getDependency()
Description copied from interface: Artifact
Get the dependency.

Specified by:
getDependency in interface Artifact
Returns:
The dependency this artifact is based on.
See Also:
Artifact.getDependency()

setPath

public void setPath(java.lang.String repositoryPath)
Description copied from interface: Artifact
Set the path to the artifact. The maven jar override facilty can be used to change the path to the artifact if the user specifies the use of a specific version.

Specified by:
setPath in interface Artifact
Parameters:
repositoryPath - Path to the artifact.
See Also:
Artifact.setPath(java.lang.String)

getPath

public java.lang.String getPath()
Description copied from interface: Artifact
Return the path of the artifact using platform specific naming conventions.

Specified by:
getPath in interface Artifact
Returns:
Path to the artifact.
See Also:
Artifact.getPath()

generatePath

public java.lang.String generatePath()
Description copied from interface: Artifact
Generate the path for this artifact given its dependency attributes.

Specified by:
generatePath in interface Artifact
Returns:
The generated path of the artifact based on the dependency attributes.

getUrlPath

public java.lang.String getUrlPath()
Description copied from interface: Artifact
Return an URL path that is platform agnostic.

Specified by:
getUrlPath in interface Artifact
Returns:
URL of the artifact.
See Also:
Artifact.getUrlPath()

getChecksumUrl

public java.lang.String getChecksumUrl()
Description copied from interface: Artifact
Return the url to the checksum file for this artifact.

Specified by:
getChecksumUrl in interface Artifact
Returns:
URL of the checksum file for this artifact.
See Also:
Artifact.getChecksumUrl()

getName

public java.lang.String getName()
Get the name of the artifact from the underlying dependency.

Specified by:
getName in interface Artifact
Returns:
The name of the underlying dependency.

exists

public boolean exists()
Description copied from interface: Artifact
Boolean flag indicating whether this artifact exists.

Specified by:
exists in interface Artifact
Returns:
Flag indicating the existance of the artifact in the local repository.
See Also:
Artifact.exists()

isSnapshot

public boolean isSnapshot()
Description copied from interface: Artifact
Boolean flag indicating whether this artifact is a snapshot.

Specified by:
isSnapshot in interface Artifact
Returns:
Flag indicating whether this artifact is a snapshot.
See Also:
Artifact.isSnapshot()

getFile

public java.io.File getFile()
Description copied from interface: Artifact
Get the location of the artifact in the local file system.

Specified by:
getFile in interface Artifact
Returns:
The location of the artifact in the local file system.
See Also:
Artifact.getFile()

verify

public void verify()
            throws ChecksumVerificationException
C H E C K S U M V E R I F I C A T I O N

Specified by:
verify in interface Artifact
Throws:
ChecksumVerificationException - when the checksum differs

getOverrideType

public java.lang.String getOverrideType()
Specified by:
getOverrideType in interface Artifact

setOverrideType

public void setOverrideType(java.lang.String overrideType)
Specified by:
setOverrideType in interface Artifact

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Artifact


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.