Class JcrAttachmentsProvider.JcrAttachmentItem

java.lang.Object
com.webmethods.caf.jcr.faces.data.JcrAttachmentsProvider.JcrAttachmentItem
All Implemented Interfaces:
IAttachmentItem
Direct Known Subclasses:
TaskJcrAttachmentsProvider.JcrTaskAttachmentItem
Enclosing class:
JcrAttachmentsProvider

protected class JcrAttachmentsProvider.JcrAttachmentItem extends Object implements IAttachmentItem
Implementation of IAttachmentItem to wrap a JCR file node.
  • Field Details

    • fileNode

      protected javax.jcr.Node fileNode
      The attachment file node
    • mwsRepositoryPath

      protected String mwsRepositoryPath
      The path prefix used to build WebDAV urls
  • Constructor Details

    • JcrAttachmentItem

      public JcrAttachmentItem(javax.jcr.Node fileNode)
      Constructor
      Parameters:
      fileNode - the attachment file node
  • Method Details

    • 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 org.apache.commons.fileupload.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