com.webmethods.caf.faces.data.csp
Class CSPContentObject

java.lang.Object
  extended by com.webmethods.caf.faces.data.csp.CSPContentObject
All Implemented Interfaces:
IAttachmentItem, Serializable

public class CSPContentObject
extends Object
implements IAttachmentItem, Serializable

CSPContentObject is a wrapper for the real file(document) stored in CSP. CSPContent combine CSPContentObjects with same origin or purpose.

See Also:
Serialized Form

Constructor Summary
CSPContentObject()
           
 
Method Summary
 CSPAttachmentsProvider getAttachmentsProvider()
           
 long getContentLength()
          Returns the length of the file (number of bytes).
 String getContentType()
          Returns the MIME type of the file content.
 String getDownloadLink()
          Returns the URL for downloading the file to a browser.
 String getFileExtension()
           
 FileItem getFileItem()
          Returns respective implementation of FileItem from this IAttachmentItem
 String getFilename()
           
 String getFileName()
          Returns the name of the attachment item.
 String getIconUrl()
          Returns the icon url (may be null)
 String getId()
          Returns the id of the attachment
 Date getLastModifiedDate()
          Returns the date when the attachment was last modified
 String getOriginalFileName()
           
 String getPath()
           
 String getPrefix()
           
 CSPPreviewImageProvider getPreviewImageProvider()
           
 String getSmiPath()
           
 boolean isDeletable()
          Returns whether the attachment is deletable by the current user
 boolean isUpdatable()
          Returns whether the attachment is updateable by the current user
 void setAttachmentsProvider(CSPAttachmentsProvider provider)
           
 void setContentLength(Long size)
           
 void setDownloadLink(String downloadLink)
           
 void setFileExtension(String fileExtension)
           
 void setFilename(String filename)
           
 void setId(String id)
           
 void setLastModifiedDate(Date date)
           
 void setOriginalFileName(String originalFileName)
           
 void setPath(String path)
           
 void setPrefix(String prefix)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CSPContentObject

public CSPContentObject()
Method Detail

setFileExtension

public void setFileExtension(String fileExtension)

getFileExtension

public String getFileExtension()
Returns:
the File extension of the file that is going to be added/updated/downloaded from CSP.

getPath

public String getPath()

setPath

public void setPath(String path)

getPrefix

public String getPrefix()

setPrefix

public void setPrefix(String prefix)

getFilename

public String getFilename()
Returns:
the filename of the file of the file that is going to be added/updated/downloaded from CSP.

setFilename

public void setFilename(String filename)

setContentLength

public void setContentLength(Long size)

getOriginalFileName

public String getOriginalFileName()
Returns:
the filename + extension of the file that is going to be added/updated/downloaded from CSP.

setOriginalFileName

public void setOriginalFileName(String originalFileName)

getContentLength

public long getContentLength()
Description copied from interface: IAttachmentItem
Returns the length of the file (number of bytes).

Specified by:
getContentLength in interface IAttachmentItem
Returns:
file size

getContentType

public String getContentType()
Description copied from interface: IAttachmentItem
Returns the MIME type of the file content. http://en.wikipedia.org/wiki/Internet_media_type

Specified by:
getContentType in interface IAttachmentItem
Returns:
the MIME type base on the file extension.

getDownloadLink

public String getDownloadLink()
Description copied from interface: IAttachmentItem
Returns the URL for downloading the file to a browser. The URL can be absolute (i.e. http://mysite/att/myfile.txt) or relative to some path in the webapp (i.e. /myappcontext/mycustomdownloadservlet/myfile.txt).

Specified by:
getDownloadLink in interface IAttachmentItem

setDownloadLink

public void setDownloadLink(String downloadLink)

getFileItem

public FileItem getFileItem()
                     throws IOException
Description copied from interface: IAttachmentItem
Returns respective implementation of FileItem from this IAttachmentItem

Specified by:
getFileItem in interface IAttachmentItem
Returns:
implementation of FileItem
Throws:
IOException

getFileName

public String getFileName()
Description copied from interface: IAttachmentItem
Returns the name of the attachment item.

Specified by:
getFileName in interface IAttachmentItem

getIconUrl

public String getIconUrl()
Description copied from interface: IAttachmentItem
Returns the icon url (may be null)

Specified by:
getIconUrl in interface IAttachmentItem

getId

public String getId()
Description copied from interface: IAttachmentItem
Returns the id of the attachment

Specified by:
getId in interface IAttachmentItem

setId

public void setId(String id)

getLastModifiedDate

public Date getLastModifiedDate()
Description copied from interface: IAttachmentItem
Returns the date when the attachment was last modified

Specified by:
getLastModifiedDate in interface IAttachmentItem

setLastModifiedDate

public void setLastModifiedDate(Date date)

isDeletable

public boolean isDeletable()
Description copied from interface: IAttachmentItem
Returns whether the attachment is deletable by the current user

Specified by:
isDeletable in interface IAttachmentItem
Returns:
true or false

isUpdatable

public boolean isUpdatable()
Description copied from interface: IAttachmentItem
Returns whether the attachment is updateable by the current user

Specified by:
isUpdatable in interface IAttachmentItem
Returns:
true or false

getPreviewImageProvider

public CSPPreviewImageProvider getPreviewImageProvider()
                                                throws COMM_Exception
Throws:
COMM_Exception

getAttachmentsProvider

public CSPAttachmentsProvider getAttachmentsProvider()

setAttachmentsProvider

public void setAttachmentsProvider(CSPAttachmentsProvider provider)

getSmiPath

public String getSmiPath()

toString

public String toString()
Overrides:
toString in class Object