Class PortalAttachmentItem
java.lang.Object
com.webmethods.caf.faces.data.attachments.AttachmentItem
com.webmethods.caf.faces.data.attachments.PortalAttachmentItem
- All Implemented Interfaces:
IAttachmentItem
,Serializable
Implementation of
com.webmethods.caf.faces.data.attachments.IAttachmentsItem
interface that exposes
a file stored in MWS as an attachment- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
Implementation of FileItem from a file stored in MWS -
Field Summary
Fields inherited from class com.webmethods.caf.faces.data.attachments.AttachmentItem
fContentLength, fContentType, fDeletable, fDownloadLink, fFileName, fIconUrl, fId, fUpdatable, lastModifiedDate
-
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorPortalAttachmentItem
(String id, String fileName, String contentType, long contentLength, String downloadLink) Constructor -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.fileupload.FileItem
Gets the FileItem representation of the attachment.Returns the icon url (may be null)boolean
Returns whether the attachment is deletable by the current userboolean
Returns whether the attachment is updateable by the current userMethods inherited from class com.webmethods.caf.faces.data.attachments.AttachmentItem
getContentLength, getContentType, getDownloadLink, getFileName, getId, getLastModifiedDate, setContentLength, setContentType, setDeletable, setDownloadLink, setFileName, setIconUrl, setId, setLastModifiedDate, setUpdatable
-
Constructor Details
-
PortalAttachmentItem
public PortalAttachmentItem()Default Constructor -
PortalAttachmentItem
public PortalAttachmentItem(String id, String fileName, String contentType, long contentLength, String downloadLink) Constructor- Parameters:
id
- Some unique identifier for the item within it's container. Each item in an attachment provider must have a unique id. The format of the id is up to the implementor. In the simple case, the id could be the same as the fileName.fileName
- The name of the attachment item.contentType
- The MIME type of the file content. http://en.wikipedia.org/wiki/Internet_media_typecontentLength
- The length of the file (number of bytes).downloadLink
- 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).
-
-
Method Details
-
getIconUrl
Description copied from interface:IAttachmentItem
Returns the icon url (may be null)- Specified by:
getIconUrl
in interfaceIAttachmentItem
- Overrides:
getIconUrl
in classAttachmentItem
-
isDeletable
public boolean isDeletable()Description copied from interface:IAttachmentItem
Returns whether the attachment is deletable by the current user- Specified by:
isDeletable
in interfaceIAttachmentItem
- Overrides:
isDeletable
in classAttachmentItem
- 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 interfaceIAttachmentItem
- Overrides:
isUpdatable
in classAttachmentItem
- Returns:
- true or false
-
getFileItem
Description copied from class:AttachmentItem
Gets the FileItem representation of the attachment. This implementation always returns null- Specified by:
getFileItem
in interfaceIAttachmentItem
- Overrides:
getFileItem
in classAttachmentItem
- Returns:
- implementation of FileItem
- Throws:
IOException
-