public class PortalAttachmentItem extends AttachmentItem
com.webmethods.caf.faces.data.attachments.IAttachmentsItem
interface that exposes
a file stored in MWS as an attachmentModifier and Type | Class and Description |
---|---|
protected static class |
PortalAttachmentItem.PortalContentFileItem
Implementation of FileItem from a file stored in MWS
|
fContentLength, fContentType, fDeletable, fDownloadLink, fFileName, fIconUrl, fId, fUpdatable, lastModifiedDate
Constructor and Description |
---|
PortalAttachmentItem()
Default Constructor
|
PortalAttachmentItem(String id,
String fileName,
String contentType,
long contentLength,
String downloadLink)
Constructor
|
Modifier and Type | Method and Description |
---|---|
org.apache.commons.fileupload.FileItem |
getFileItem()
Gets the FileItem representation of the attachment.
|
String |
getIconUrl()
Returns the icon url (may be null)
|
boolean |
isDeletable()
Returns whether the attachment is deletable by the
current user
|
boolean |
isUpdatable()
Returns whether the attachment is updateable by the
current user
|
getContentLength, getContentType, getDownloadLink, getFileName, getId, getLastModifiedDate, setContentLength, setContentType, setDeletable, setDownloadLink, setFileName, setIconUrl, setId, setLastModifiedDate, setUpdatable
public PortalAttachmentItem()
public PortalAttachmentItem(String id, String fileName, String contentType, long contentLength, String downloadLink)
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).public String getIconUrl()
IAttachmentItem
getIconUrl
in interface IAttachmentItem
getIconUrl
in class AttachmentItem
public boolean isDeletable()
IAttachmentItem
isDeletable
in interface IAttachmentItem
isDeletable
in class AttachmentItem
public boolean isUpdatable()
IAttachmentItem
isUpdatable
in interface IAttachmentItem
isUpdatable
in class AttachmentItem
public org.apache.commons.fileupload.FileItem getFileItem() throws IOException
AttachmentItem
getFileItem
in interface IAttachmentItem
getFileItem
in class AttachmentItem
IOException