com.ibm.ram.client
Class RAMArtifact

java.lang.Object
  extended by com.ibm.ram.common.data.Artifact
      extended by com.ibm.ram.client.RAMArtifact
Direct Known Subclasses:
LocalFileArtifact

public class RAMArtifact
extends Artifact

Represents the metadata of an artifact. This class is intended to be sub-classed. getContents() returns an input stream to download the artifact content.

Since:
7.1
Author:
kbauer

Field Summary
 
Fields inherited from class com.ibm.ram.common.data.Artifact
FILE_DELIM, TYPE_FILE, TYPE_FOLDER, TYPE_URL
 
Constructor Summary
protected RAMArtifact()
           
 
Method Summary
 java.io.InputStream downloadContents()
          Returns the content from the server if not overwritten by sub class.
 RAMAsset getAsset()
           
 long getCreationDate()
           
 java.lang.String getLabel()
          Returns the Label associated with the artifact
 java.lang.String getMimeType()
           
 java.lang.String getName()
          The name of the artifact
 java.lang.String getPath()
          Returns the path to the artifact from the root.
 ArtifactReference getReference()
           
 long getSize()
          The size of the artifact.
 java.lang.String getType()
          The type of the artifact.
 void setAsset(RAMAsset asset)
          Set the internal asset
 void setCreationDate(long creationDate)
          The date the artifact was cerated.
 void setLabel(java.lang.String label)
          Sets the label associated with the artifact
 void setMimeType(java.lang.String mimeType)
          Sets the mime type associated with the artifact if one has been set.
 void setName(java.lang.String name)
          The name of the artifact.
 void setPath(java.lang.String path)
          The path to the artifact.
 void setReference(ArtifactReference reference)
           
 void setSize(long size)
          The size of the artifact.
 void setType(java.lang.String type)
          The artifact type.
 
Methods inherited from class com.ibm.ram.common.data.Artifact
getChecksum, setChecksum, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RAMArtifact

protected RAMArtifact()
Method Detail

getAsset

public RAMAsset getAsset()
Returns:
The asset this Artifact belongs to
Since:
7.1

setAsset

public void setAsset(RAMAsset asset)
Set the internal asset

Since:
7.1

getName

public java.lang.String getName()
Description copied from class: Artifact
The name of the artifact

Overrides:
getName in class Artifact
Returns:
This file name of the artifact
Since:
7.1

setName

public void setName(java.lang.String name)
Description copied from class: Artifact
The name of the artifact.

Overrides:
setName in class Artifact
Parameters:
name - The file name of the artifact
Since:
7.1

getPath

public java.lang.String getPath()
Description copied from class: Artifact
Returns the path to the artifact from the root. Path of the root artifact is null. All other path are relative to the artifact root.

Overrides:
getPath in class Artifact
Returns:
The path (not including the file name) for this artifact
Since:
7.1

setPath

public void setPath(java.lang.String path)
Description copied from class: Artifact
The path to the artifact. Path of the root artifact is null. All other path are relative to the artifact root.

Overrides:
setPath in class Artifact
Parameters:
path - The path (not including the file name) for this artifact
Since:
7.1

downloadContents

public java.io.InputStream downloadContents()
                                     throws RAMRuntimeException,
                                            java.io.IOException
Returns the content from the server if not overwritten by sub class.

Returns:
Throws:
RAMRuntimeException
java.io.IOException
Since:
7.1

getCreationDate

public long getCreationDate()
Overrides:
getCreationDate in class Artifact
Returns:
Returns the creationDate.

getType

public java.lang.String getType()
Description copied from class: Artifact
The type of the artifact.

Overrides:
getType in class Artifact
See Also:
Artifact.TYPE_FILE, Artifact.TYPE_FOLDER, Artifact.TYPE_URL

getSize

public long getSize()
Description copied from class: Artifact
The size of the artifact.

Overrides:
getSize in class Artifact

getLabel

public java.lang.String getLabel()
Returns the Label associated with the artifact

Overrides:
getLabel in class Artifact
Returns:
Returns the label.
Since:
7.1

setLabel

public void setLabel(java.lang.String label)
Sets the label associated with the artifact

Overrides:
setLabel in class Artifact
Parameters:
label -
Since:
7.1

getMimeType

public java.lang.String getMimeType()
Overrides:
getMimeType in class Artifact
Returns:
Returns the mime type.

setMimeType

public void setMimeType(java.lang.String mimeType)
Sets the mime type associated with the artifact if one has been set.

Overrides:
setMimeType in class Artifact
Parameters:
label - The mime type to set.
Since:
7.5.0.1

getReference

public ArtifactReference getReference()
Overrides:
getReference in class Artifact
Returns:
Returns the reference.

setCreationDate

public void setCreationDate(long creationDate)
Description copied from class: Artifact
The date the artifact was cerated.

Overrides:
setCreationDate in class Artifact

setReference

public void setReference(ArtifactReference reference)
Overrides:
setReference in class Artifact
Parameters:
reference - The reference to set.

setSize

public void setSize(long size)
Description copied from class: Artifact
The size of the artifact.

Overrides:
setSize in class Artifact

setType

public void setType(java.lang.String type)
Description copied from class: Artifact
The artifact type.

Overrides:
setType in class Artifact
See Also:
Artifact.TYPE_FILE, Artifact.TYPE_FOLDER, Artifact.TYPE_URL