com.webmethods.caf.faces.data.attachments
Class LocalTempAttachmentsProvider

java.lang.Object
  extended by com.webmethods.caf.faces.data.attachments.LocalTempAttachmentsProvider
All Implemented Interfaces:
IAttachmentsProvider
Direct Known Subclasses:
JcrTempAttachmentsProvider

public class LocalTempAttachmentsProvider
extends Object
implements IAttachmentsProvider

Attachment Provider that stores the temp files in a temp folder on the MWS server. The attachments provided are not URL addressable so you can not click the link to get them from the list.


Nested Class Summary
static class LocalTempAttachmentsProvider.FileItemImpl
           
static class LocalTempAttachmentsProvider.TempAttachmentItem
           
 
Field Summary
protected  File fTempFolder
           
 
Constructor Summary
LocalTempAttachmentsProvider()
           
 
Method Summary
 void addAttachment(FileItem fileItem, String encoding)
          Add Attachment
protected  void finalize()
           
 boolean getHasAttachments()
          Returns whether the attachment provider has any attachments
protected  File getTempFolder()
           
 boolean isAddAttachmentsAvailable()
          Returns whether attachments can be added
 List listAttachments()
          Returns a list of the current attachments
 void removeAttachment(String attachmentID)
          Remove Attachment
 void updateAttachment(String attachmentID, FileItem fileItem, String encoding)
          Update an Attachment
 void valueBound(HttpSessionBindingEvent arg0)
           
 void valueUnbound(HttpSessionBindingEvent arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fTempFolder

protected File fTempFolder
Constructor Detail

LocalTempAttachmentsProvider

public LocalTempAttachmentsProvider()
Method Detail

getTempFolder

protected File getTempFolder()

valueBound

public void valueBound(HttpSessionBindingEvent arg0)

valueUnbound

public void valueUnbound(HttpSessionBindingEvent arg0)

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

isAddAttachmentsAvailable

public boolean isAddAttachmentsAvailable()
Description copied from interface: IAttachmentsProvider
Returns whether attachments can be added

Specified by:
isAddAttachmentsAvailable in interface IAttachmentsProvider
Returns:
true or false

getHasAttachments

public boolean getHasAttachments()
Description copied from interface: IAttachmentsProvider
Returns whether the attachment provider has any attachments

Specified by:
getHasAttachments in interface IAttachmentsProvider
Returns:
true or false

addAttachment

public void addAttachment(FileItem fileItem,
                          String encoding)
Description copied from interface: IAttachmentsProvider
Add Attachment

Specified by:
addAttachment in interface IAttachmentsProvider
Parameters:
fileItem - the attachment content
encoding - the encoding of the attachment file (if known)

listAttachments

public List listAttachments()
Description copied from interface: IAttachmentsProvider
Returns a list of the current attachments

Specified by:
listAttachments in interface IAttachmentsProvider
Returns:
collection of AttachmentItems

removeAttachment

public void removeAttachment(String attachmentID)
Description copied from interface: IAttachmentsProvider
Remove Attachment

Specified by:
removeAttachment in interface IAttachmentsProvider
Parameters:
attachmentID - the id of the attachment to remove

updateAttachment

public void updateAttachment(String attachmentID,
                             FileItem fileItem,
                             String encoding)
Description copied from interface: IAttachmentsProvider
Update an Attachment

Specified by:
updateAttachment in interface IAttachmentsProvider
Parameters:
attachmentID - the id of the attachment to update
fileItem - the new attachment content
encoding - the encoding of the attachment file (if known)