org.repoweb.model.common
Class AbstractArtifact

java.lang.Object
  extended byorg.repoweb.model.common.AbstractArtifact
All Implemented Interfaces:
Artifact, ArtifactInfo
Direct Known Subclasses:
FArtifact, JArtifact

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

Abstract class to ease implementation of the Artifact interface.


Nested Class Summary
 class AbstractArtifact.BadArtifactFileException
          Signal a bad artifact file name.
 
Constructor Summary
protected AbstractArtifact(java.io.File file)
           
 
Method Summary
 java.lang.String getArtifactId()
          Retrieve the Artifact Id.
protected  java.io.File getFile()
           
 java.lang.String getFileName()
          Retrieve the file name of the artifact.
 java.lang.String getGroupId()
          Retrieve the Group Id.
 java.lang.String getId()
          Return an id for an artifact.
 java.lang.String getType()
          Retrieve the artifact type.
 java.lang.String getVersion()
          Retrieve the version of this artifact.
 boolean isOverridden()
          Indicates if the fileName is conform to the standard maven's naming schema.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.repoweb.model.Artifact
getInputStream, getLength, getPom
 

Constructor Detail

AbstractArtifact

protected AbstractArtifact(java.io.File file)
                    throws AbstractArtifact.BadArtifactFileException
Method Detail

getGroupId

public java.lang.String getGroupId()
Description copied from interface: ArtifactInfo
Retrieve the Group Id.

Specified by:
getGroupId in interface ArtifactInfo
Returns:
id (e.g. 'struts')

getArtifactId

public java.lang.String getArtifactId()
Description copied from interface: ArtifactInfo
Retrieve the Artifact Id.

Specified by:
getArtifactId in interface ArtifactInfo
Returns:
id (e.g. 'junit')

getId

public java.lang.String getId()
Description copied from interface: Artifact
Return an id for an artifact.

Specified by:
getId in interface Artifact
Returns:
A unique (version independent) of an artifact (e.g. 'struts:struts-legacy').

getType

public java.lang.String getType()
Description copied from interface: ArtifactInfo
Retrieve the artifact type. This is determined by the folder containing the artifact.

Specified by:
getType in interface ArtifactInfo
Returns:
the artifact type (e.g. 'jar' for 'jars' folder)

getVersion

public java.lang.String getVersion()
Description copied from interface: ArtifactInfo
Retrieve the version of this artifact. Returns an empty string when no version has been given.

Specified by:
getVersion in interface ArtifactInfo
Returns:
version label (e.g. '3.8.1-SNAPSHOT').

isOverridden

public boolean isOverridden()
Description copied from interface: ArtifactInfo
Indicates if the fileName is conform to the standard maven's naming schema.

[maven]/[groupId]/[type]s/[artifactId]-[version].[type]

Specified by:
isOverridden in interface ArtifactInfo
Returns:
true if this artifact does not follow the default naming schema.

getFileName

public java.lang.String getFileName()
Description copied from interface: ArtifactInfo
Retrieve the file name of the artifact.

Specified by:
getFileName in interface ArtifactInfo
Returns:
file name (e.g. 'junit-3.8.1.jar')

getFile

protected java.io.File getFile()

toString

public java.lang.String toString()


Copyright © 2003-2005 Repoweb. All Rights Reserved.