com.versionone.om
Class Attachment
java.lang.Object
com.versionone.om.Entity
com.versionone.om.Attachment
public class Attachment
- extends Entity
Represents an attachment in the VersionOne system.
| Methods inherited from class com.versionone.om.Entity |
equals, get, getChangeComment, getChangeDate, getChangedBy, getCreateComment, getCreateDate, getCreatedBy, getID, getInstance, hashCode, save, save, toString |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
getURL
public java.lang.String getURL()
- Returns:
- URL to VersionOne Detail Page for this Attachment.
getContentURL
public java.lang.String getContentURL()
- Returns:
- VersionOne URL where the contents of this attachment may be
downloaded from.
getAsset
public BaseAsset getAsset()
- Returns:
- Asset this attachment is related to.
setAsset
public void setAsset(BaseAsset asset)
- Parameters:
asset - this attachment is related to.
getDescription
public java.lang.String getDescription()
- Returns:
- Description of this attachment.
setDescription
public void setDescription(java.lang.String description)
- Parameters:
description - of this attachment.
getContentType
public java.lang.String getContentType()
- Returns:
- Content Type of this attachment.
setContentType
public void setContentType(java.lang.String contentType)
- Parameters:
contentType - of this attachment.
getFilename
public java.lang.String getFilename()
- Returns:
- Filename of this attachment.
setFilename
public void setFilename(java.lang.String filename)
- Parameters:
filename - Filename of this attachment.
getName
public java.lang.String getName()
- Returns:
- Name of this attachment.
setName
public void setName(java.lang.String name)
- Parameters:
name - Name of this attachment.
getType
public IListValueProperty getType()
- Returns:
- Type of this attachment.
writeTo
public void writeTo(java.io.OutputStream output)
throws ApplicationUnavailableException
- Write this attachment's content to the output stream.
- Parameters:
output - Stream to write the content to.
- Throws:
ApplicationUnavailableException - if coping fails.
readFrom
public void readFrom(java.io.InputStream input)
throws ApplicationUnavailableException,
AttachmentLengthExceededException
- Read the attachment's content from the input stream. Set the ContentType
and Filename properties before calling this method.
- Parameters:
input - Stream to read the content from.
- Throws:
ApplicationUnavailableException - if appears any problem with
connection to service.
AttachmentLengthExceededException - if attachment is too long.
canDelete
public boolean canDelete()
- Returns:
- True if the attachment can be deleted.
delete
public void delete()
- Deletes the attachment.
- Throws:
java.lang.UnsupportedOperationException - The item is an invalid state for
the Operation.