|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccs.mime.MUtil
public class MUtil
Utility methods for dealing with various MIME constructs.
Method Summary | |
---|---|
static java.lang.String |
getExtn(java.lang.String path,
char separator)
Return the "filename extension" for a path. |
static java.lang.String |
getNotExtn(java.lang.String path,
char separator)
The dual of getExtn ; returns everything before the extension. |
static java.lang.String |
getQuery(java.lang.String path,
char separator)
Return any presumed query string found on the supplied path. |
static HeaderedEntity[] |
rawMultipartSet(java.io.InputStream src,
int len,
java.lang.String contentTypeRaw)
Separates an input stream, which contains data in the MIME multipart format, into an array of HeaderedEntity objects, each of which represents an individual part of the multipart. |
static java.lang.String |
subValue(java.lang.String body,
java.lang.String subname)
Undocumented. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String subValue(java.lang.String body, java.lang.String subname)
public static HeaderedEntity[] rawMultipartSet(java.io.InputStream src, int len, java.lang.String contentTypeRaw) throws java.io.IOException
NOTE: This is a simplified and not fully conformant implementation which is
designed for reading multipart/form-data coming back from browsers. (It trades
improved efficiency for conformance by failing to support some MIME features
which are generally not used in this specific context). For all other applications
you should use MimeEntity
instead.
src
- The source inputstream containing the multipart.len
- The length of src, if known; otherwise, supply -1 to swallow the whole stream.contentTypeRaw
- apps which supply multipart MIMEs supply a header field
preceding the start of the multipart, which contains a clause specifying the
interpart boundary string. Typically this is the content-type header; the header
is sthg like multipart/form-data; boundary=--FLKJDHRIUvlckjglfdkjh
.
Supply the complete header; this method will parse it to retrieve the boundary.
java.io.IOException
public static java.lang.String getExtn(java.lang.String path, char separator)
path
- The path to extract the extension from. If the path includes
a '?' character, this is assumed to be the start of a transplanted URL query
string, and is stripped.separator
- The character which separates path elements on the
"filesystem" (or pseudo-filesystem in the case of hierarchical URLs)
the path belongs to. '\\' for Win32, '/' for pretty much everything else.
public static java.lang.String getNotExtn(java.lang.String path, char separator)
getExtn
; returns everything before the extension.
path
- The path to from which to extract everything before the
extension. If the path includes a '?' character, this is assumed to be
the start of a transplanted URL query string, and is stripped.separator
- The character which separates path elements on the
"filesystem" (or pseudo-filesystem in the case of hierarchical URLs)
the path belongs to. '\\' for Win32, '/' for pretty much everything else.
public static java.lang.String getQuery(java.lang.String path, char separator)
getExtn
and getNotExtn
: path ===
getNotExtn(path) + getExtn(path) + "?" + getQuery(path).
path
- The path from which to extract the supposed query string.separator
- The character which separates path elements on the
"filesystem" (or pseudo-filesystem in the case of hierarchical URLs)
the path belongs to. '\\' for Win32, '/' for pretty much everything else.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |