com.webmethods.caf.jcr.faces.data
Class JcrAttachmentsProvider.JcrAttachmentItem

java.lang.Object
  extended by com.webmethods.caf.jcr.faces.data.JcrAttachmentsProvider.JcrAttachmentItem
All Implemented Interfaces:
IAttachmentItem
Enclosing class:
JcrAttachmentsProvider

protected class JcrAttachmentsProvider.JcrAttachmentItem
extends Object
implements IAttachmentItem

Implementation of IAttachmentItem to wrap a JCR file node.


Field Summary
protected  Node fileNode
          The attachment file node
protected  String mwsRepositoryPath
          The path prefix used to build WebDAV urls
 
Constructor Summary
JcrAttachmentsProvider.JcrAttachmentItem(Node fileNode)
          Constructor
 
Method Summary
 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.
 FileItem getFileItem()
          Returns respective implementation of FileItem from this IAttachmentItem
 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
 boolean isDeletable()
          Returns whether the attachment is deletable by the current user
 boolean isUpdatable()
          Returns whether the attachment is updateable by the current user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileNode

protected Node fileNode
The attachment file node


mwsRepositoryPath

protected String mwsRepositoryPath
The path prefix used to build WebDAV urls

Constructor Detail

JcrAttachmentsProvider.JcrAttachmentItem

public JcrAttachmentsProvider.JcrAttachmentItem(Node fileNode)
Constructor

Parameters:
fileNode - the attachment file node
Method Detail

getContentLength

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

Specified by:
getContentLength in interface IAttachmentItem

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

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

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

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

getLastModifiedDate

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

Specified by:
getLastModifiedDate in interface IAttachmentItem