|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ws4d.java.util.MIMEUtil
public class MIMEUtil
Utility class for MIME handling.
| Field Summary | |
|---|---|
static int |
DEFAULT_MIME_BUFFER
|
| Constructor Summary | |
|---|---|
MIMEUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
contentToExtension(java.lang.String mime)
Returns a file extension that is most likely with given Content-Type |
static java.lang.String |
estimateContentType(java.lang.String filename)
Gets estimated Content-Type via filename. |
static java.lang.String |
extensionContentType(java.lang.String fileExt)
Gets Content-Type via file extension. |
static boolean |
readBoundary(java.io.InputStream in,
byte[] boundary)
Reads the boundary string. |
static void |
readHeaderFields(java.io.InputStream in,
HashMap headerfields)
Reads MIME header fields from the input stream. |
static void |
serializeAttachment(java.io.OutputStream out,
IncomingAttachment attachment)
|
static void |
writeBoundary(java.io.OutputStream out,
byte[] boundary,
boolean crlf,
boolean last)
Writes a MIME boundary. |
static void |
writeHeaderFields(java.io.OutputStream out,
HashMap headerfields)
Writes MIME header fields to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int DEFAULT_MIME_BUFFER
| Constructor Detail |
|---|
public MIMEUtil()
| Method Detail |
|---|
public static boolean readBoundary(java.io.InputStream in,
byte[] boundary)
throws java.io.IOException
in - input stream to read from.boundary - the given boundary information.
java.io.IOException
public static void writeBoundary(java.io.OutputStream out,
byte[] boundary,
boolean crlf,
boolean last)
throws java.io.IOException
out - boundary - crlf - last -
java.io.IOException
public static void serializeAttachment(java.io.OutputStream out,
IncomingAttachment attachment)
throws java.io.IOException,
AttachmentException
java.io.IOException
AttachmentException
public static void writeHeaderFields(java.io.OutputStream out,
HashMap headerfields)
throws java.io.IOException
out - headerfields -
java.io.IOException
public static void readHeaderFields(java.io.InputStream in,
HashMap headerfields)
throws java.io.IOException,
ProtocolException
in - the input stream to read from.headerfields - Hashtable to store the fields in.
java.io.IOException
ProtocolExceptionpublic static java.lang.String estimateContentType(java.lang.String filename)
filename - fileName with extension.
public static java.lang.String contentToExtension(java.lang.String mime)
mime - MIME Type
public static java.lang.String extensionContentType(java.lang.String fileExt)
fileExt - file extension.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||