|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectelectric.util.mime.MIMEData
MIMEData.
| Field Summary | |
MIMEHeaders |
headers
|
java.io.InputStream |
input
|
| Fields inherited from interface electric.util.mime.IMIMEConstants |
DATA_DIRECTORY, DEFAULT_MIMEDATA_DIRECTORY, DEFAULT_START_MIME_PART, MIME_ATTACHMENT_STYLE, MIME_EXTENSION, STAR_SLASH_STAR_DATAHANDLER |
| Constructor Summary | |
MIMEData()
|
|
MIMEData(byte[] bytes)
Construct a MIMEData out of the bytes provided, in the content type "application/binary". |
|
MIMEData(byte[] bytes,
java.lang.String contentType)
Construct a MIMEData out of the bytes provided in the content type specified. |
|
MIMEData(java.io.File file)
Construct a MIMEData out of the file, with the content-type "application/binary". |
|
MIMEData(java.io.File file,
java.lang.String contentType)
Construct a MIMEData with the file provided as the body, of the content type provided. |
|
MIMEData(java.io.InputStream input,
int contentLength)
Construct a MIMEData out of the InputStream, with a content length provided, of type "application/binary". |
|
MIMEData(java.io.InputStream input,
int contentLength,
java.lang.String contentType)
Construct a MIMEData out of the InputStream, with the content-length provided, of the type provided. |
|
MIMEData(java.io.InputStream input,
java.lang.String contentLocation,
Context context)
Construct a MIMEData from data on the InputStream, with the Content-Location, using whatever parameters are in the Context. |
|
MIMEData(java.io.InputStream input,
java.lang.String contentLocation,
java.lang.String seperator,
Context context)
Construct a MIMEData from data on the InputStream, with the Content-Location, using whatever parameters are in the Context. |
|
MIMEData(java.lang.String content)
Construct a MIMEData out of the content provided. |
|
MIMEData(java.lang.String content,
java.lang.String contentType)
Construct a MIMEData out of the content provided, in the content type provided. |
|
MIMEData(java.net.URL url)
Construct a MIMEData out of the url provided. |
|
| Method Summary | |
boolean |
dispose()
Dispose of me, via my handler. |
java.lang.String |
generateId()
Generate a Universally Unique id for me. |
byte[] |
getBytes()
Return an array of bytes of my content. |
java.lang.String |
getContentId()
Return my "Content-ID" header. |
java.lang.String |
getContentLabel()
Return my appropriate label according to the MIME Spec. |
int |
getContentLength()
Return the length of my body. |
java.lang.String |
getContentType()
Return my Content-Type. |
byte[] |
getDelimiter()
Get my MIME part separator. |
int |
getFormattedContentLength()
to understand how the content length is calculated consider the following template of a mime data part in a message: -------------------------------- | EOL | |------------------------------| | --mime_boundary | - this one is set by setDelimeter() |------------------------------| | EOL | |------------------------------| | headers | - the headers include Content-Location, |------------------------------| Content-ID, and Content-Type | EOL | |------------------------------| | content | |------------------------------| | EOL | -------------------------------- |
java.io.InputStream |
getFormattedInputStream()
Return an InputStream with the header, body, and seperator for the MIMEData object. |
IDataHandler |
getHandler()
Return my MIME data handler. |
java.io.InputStream |
getInputStream()
Return the InputStream that represents my body. |
void |
readContent(java.io.InputStream inputStream,
Context context)
Create the InputStream for my body from the InputStream. |
void |
readHeaders(java.io.InputStream input)
Read my headers off the InputStream, and do what preprocessing needs to be done. |
void |
setBaseContentLocation(java.lang.String baseContentLocation)
Set my baseContentLocation. |
void |
setContentLabel(java.lang.String contentLabel)
|
void |
setContentLength(int contentLength)
Set the length of my body. |
void |
setContentType(java.lang.String type)
Set my Content-Type. |
void |
setDelimiter(byte[] delimiter)
Set my MIME part separator. |
void |
setHandler(IDataHandler handler)
Set my MIME data handler. |
void |
setInputStream(java.io.InputStream input)
Set the InputStream that represents my body. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public MIMEHeaders headers
public java.io.InputStream input
| Constructor Detail |
public MIMEData()
public MIMEData(java.lang.String content)
content -
public MIMEData(java.lang.String content,
java.lang.String contentType)
content - contentType - public MIMEData(byte[] bytes)
bytes -
public MIMEData(byte[] bytes,
java.lang.String contentType)
bytes - contentType -
public MIMEData(java.net.URL url)
throws java.io.IOException
url -
java.io.IOException
public MIMEData(java.io.InputStream input,
int contentLength)
input - contentLength - the length of the content.
public MIMEData(java.io.InputStream input,
int contentLength,
java.lang.String contentType)
input - The input stream where we pull the content from.contentLength - the length of the content.contentType - The contentType that should be placed in the header of this MIME part.
public MIMEData(java.io.File file)
throws java.io.FileNotFoundException
file - A handle to the file to be sent as a MIMEData
java.io.FileNotFoundException
public MIMEData(java.io.File file,
java.lang.String contentType)
throws java.io.FileNotFoundException
file - A handle to the file to be sent as a MIMEDatacontentType - The contentType that should be placed in the header of this MIME part.
java.io.FileNotFoundException
public MIMEData(java.io.InputStream input,
java.lang.String contentLocation,
Context context)
throws java.io.IOException
input - contentLocation - context -
java.io.IOException
public MIMEData(java.io.InputStream input,
java.lang.String contentLocation,
java.lang.String seperator,
Context context)
throws java.io.IOException
input - The input stream where we pull the content from.contentLocation - seperator - The MIMEData Seperator for this message.context -
java.io.IOException| Method Detail |
public void setInputStream(java.io.InputStream input)
input - public java.io.InputStream getInputStream()
public void setContentType(java.lang.String type)
type - public java.lang.String getContentType()
public int getContentLength()
public void setContentLength(int contentLength)
contentLength -
public java.io.InputStream getFormattedInputStream()
throws java.io.IOException
java.io.IOException
public int getFormattedContentLength()
throws java.io.IOException
java.io.IOExceptionpublic void setBaseContentLocation(java.lang.String baseContentLocation)
baseContentLocation - public java.lang.String getContentId()
public java.lang.String getContentLabel()
public void setContentLabel(java.lang.String contentLabel)
contentLabel - public void setHandler(IDataHandler handler)
handler - The new value.public IDataHandler getHandler()
public byte[] getBytes()
throws java.io.IOException
java.io.IOException
public boolean dispose()
throws java.io.IOException
java.io.IOException
public void readHeaders(java.io.InputStream input)
throws java.io.IOException
input -
java.io.IOException
public void readContent(java.io.InputStream inputStream,
Context context)
throws java.io.IOException
inputStream - context -
java.io.IOExceptionpublic java.lang.String generateId()
generateId in interface IIDGeneratorpublic void setDelimiter(byte[] delimiter)
delimiter - public byte[] getDelimiter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||