Collaboration API Documentation

com.filenet.bso.api.collaboration.data
Class EmailSubpartInfo

java.lang.Object
  |
  +--com.filenet.bso.api.collaboration.data.EmailSubpartInfo
All Implemented Interfaces:
java.io.Serializable

public class EmailSubpartInfo
extends java.lang.Object
implements java.io.Serializable

This class encapsulates the data of a single subpart of an email message. Each subpart corresponds to one of the lower-level JavaMail MimePart class, which is part of the whole MimeMessage, but will not include MimeMultipart parts. These subparts might be textual (MIME type text/-), inline (usually MIME type image/- or sound/-) or attachments (any non-multipart MIME type).

See Also:
Serialized Form

Constructor Summary
EmailSubpartInfo(Teamspace teamspace, java.lang.String ownerID, java.lang.String contentType, java.lang.String filename, byte[] bytes, int elemNumber)
          Alternate constructor used when not basing the subpart off of a MimePart object.
 
Method Summary
 byte[] getBytes()
          Fetch the content byte array.
 com.filenet.wcm.api.TransportInputStream getContent()
          Return an input stream for the content of this subpart.
 java.lang.String getContentID()
          Get the Content-Id: header for this part.
 java.lang.String getContentLocation()
          Get the Content-Location: header for this part.
 java.lang.String getContentType()
          Get the type/subtype MIME type for this subpart.
 int getElemNumber()
          Get the element number for this part.
 java.lang.String getFilename()
          Get the "best guess" filename for this subpart.
 java.lang.String getOwnerID()
          Get the member ID for whoever's creating this email subpart.
 com.filenet.wcm.api.Properties getProperties(com.filenet.wcm.api.Document parent)
          Get the properties that are associated with this subpart.
 Teamspace getTeamspace()
          Get the teamspace that this subpart is part of.
 void setBytes(byte[] bytes)
          Set the content byte array.
 void setElemNumber(int elemNumber)
          Set the element number for this part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailSubpartInfo

public EmailSubpartInfo(Teamspace teamspace,
                        java.lang.String ownerID,
                        java.lang.String contentType,
                        java.lang.String filename,
                        byte[] bytes,
                        int elemNumber)
Alternate constructor used when not basing the subpart off of a MimePart object.
Parameters:
teamspace - the teamspace that this subpart is in
ownerID - the owner of this subpart
contentType - the Mime type of this subpart
filename - the filename to be used with this subpart
bytes - a byte array of the content
elemNumber - the element number
Method Detail

getTeamspace

public Teamspace getTeamspace()
Get the teamspace that this subpart is part of.
Returns:
the teamspace

getContentID

public java.lang.String getContentID()
Get the Content-Id: header for this part. This will be null if there's no such header.
Returns:
the value of the Content-Id: header

getElemNumber

public int getElemNumber()
Get the element number for this part. This will be 1..N for attachment parts, 1000001..N for inline parts and 0 for the entire message itself.
Returns:
the element number

setElemNumber

public void setElemNumber(int elemNumber)
Set the element number for this part.
Parameters:
elemNumber - the new element number for this part.

getContentLocation

public java.lang.String getContentLocation()
Get the Content-Location: header for this part. This will be null if there's no such header.
Returns:
the value of the Content-Location: header

getContentType

public java.lang.String getContentType()
Get the type/subtype MIME type for this subpart. This is derived from the subpart's Content-Type: header.
Returns:
the type/subtype MIME type

getFilename

public java.lang.String getFilename()
Get the "best guess" filename for this subpart. This is determined by first looking for a Content-Disposition: filename= argument and, if none, then seeing if there's something that looks like a filename (or part of one) in the Content-Location: header and finally, if all else fails, constructing one from the major MIME type (e.g., text, image or sound). If there's no filename extension, then try to lookup a common one given the MIME type (e.g., a image/jpeg type would yield a .jpg extension).
Returns:
the filename

getOwnerID

public java.lang.String getOwnerID()
Get the member ID for whoever's creating this email subpart.
Returns:
the member ID

getContent

public com.filenet.wcm.api.TransportInputStream getContent()
Return an input stream for the content of this subpart. Since this is a JavaAPI TransportInputStream, this will also have an associated MIME type and filename.
Returns:
an input stream (with MIME type and filename) for the content

getBytes

public byte[] getBytes()
Fetch the content byte array.
Returns:
the byte array of the subpart's content

setBytes

public void setBytes(byte[] bytes)
Set the content byte array.
Parameters:
bytes - the byte array for the subpart's content

getProperties

public com.filenet.wcm.api.Properties getProperties(com.filenet.wcm.api.Document parent)
Get the properties that are associated with this subpart. This is returned in a form which can be directly used when created the Content Engine object.
Parameters:
parent - the owning email message
Returns:
the properties for this subpart

Collaboration API Documentation

Copyright ?2002 - 2005 FileNet Corporation. All rights reserved.