org.ws4d.java.attachment
Class AbstractAttachment

java.lang.Object
  extended by org.ws4d.java.attachment.AbstractAttachment
All Implemented Interfaces:
Attachment

public abstract class AbstractAttachment
extends java.lang.Object
implements Attachment

Attachment container. Provides access to an attachment's metadata (content ID, content type and transfer encoding).


Field Summary
 
Fields inherited from interface org.ws4d.java.attachment.Attachment
FILE_ATTACHMENT, MEMORY_ATTACHMENT, OUTPUTSTREAM_ATTACHMENT, STREAM_ATTACHMENT
 
Method Summary
 java.lang.String getContentId()
          Return the content ID of this attachment.
 InternetMediaType getContentType()
          The content type (MIME) for this attachment.
 java.lang.String getTransferEncoding()
          The encoding for this attachment.
 boolean isAvailable()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ws4d.java.attachment.Attachment
dispose, getType, serialize
 

Method Detail

isAvailable

public boolean isAvailable()

getContentId

public java.lang.String getContentId()
Description copied from interface: Attachment
Return the content ID of this attachment. The content ID is used to distinguish the attachment within a MIME package and to enable linking to it from within ParameterValue instances.

Specified by:
getContentId in interface Attachment
Returns:
this attachment's content ID

getContentType

public InternetMediaType getContentType()
                                 throws AttachmentException
Description copied from interface: Attachment
The content type (MIME) for this attachment.

Specified by:
getContentType in interface Attachment
Returns:
the content type
Throws:
AttachmentException - if attachment processing is not supported within the current runtime or obtaining the attachment failed for any reason

getTransferEncoding

public java.lang.String getTransferEncoding()
                                     throws AttachmentException
Description copied from interface: Attachment
The encoding for this attachment.

Specified by:
getTransferEncoding in interface Attachment
Returns:
the encoding
Throws:
AttachmentException - if attachment processing is not supported within the current runtime or obtaining the attachment failed for any reason