com.atlassian.confluence.pages
Class AttachmentData

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.pages.AttachmentData
All Implemented Interfaces:
FileExportable, java.lang.Cloneable

public class AttachmentData
extends com.atlassian.core.bean.EntityObject
implements FileExportable

This class encapsulates Attachment metadata and maintains an InputStream that represents the data for the Attachment object.

This class is designed to only be used once, since the InputStream can only be used once. It should only be used within the AttachmentDataDao classes, when dealing with database Attachment storage.

Once an object has been used in a Hibernate session (e.g. saved), it should be evicted from the session, otherwise the object may be cached and a consumed InputStream will be returned the next time the object is used. Evicting it will cause a new object to be created.


Constructor Summary
AttachmentData()
           
AttachmentData(int version, Attachment attachment, java.io.InputStream data)
           
 
Method Summary
 Attachment getAttachment()
           
 java.io.InputStream getData()
           
 int getVersion()
           
 void setAttachment(Attachment attachment)
           
 void setData(java.io.InputStream data)
           
 void setVersion(int version)
           
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCreationDate, getCurrentDate, getId, getLastModificationDate, hashCode, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttachmentData

public AttachmentData()

AttachmentData

public AttachmentData(int version,
                      Attachment attachment,
                      java.io.InputStream data)
Method Detail

getVersion

public int getVersion()

setVersion

public void setVersion(int version)

getAttachment

public Attachment getAttachment()

setAttachment

public void setAttachment(Attachment attachment)

getData

public java.io.InputStream getData()

setData

public void setData(java.io.InputStream data)


Copyright © 2003-2010 Atlassian. All Rights Reserved.