Vivek Pandey wrote:
> Kohsuke,
>
> Just contentType in Decoder.decode(inputStream, contentType) may not be
> sufficient.
>
> for example AttachmentStreamDecoder would need information about other
> HTTP header parameters, such as Multipart/Related header parameters,
> such as boundary and start. What we need here is something like
> ContentType from JavaMail, that can give easy access to the Mime
> parameters or the assumption here is that decode gets the compelte
> stream that includes the HTTP headers?
Hmm. Good point.
We can't just give it the complete HTTP header stream, because the
transport might not be HTTP. Perhaps we'd have to pass in a callback so
that the decoder can access headers? (I guess the complete MIME headers
need to be exposed to WebSericeContext anyway.)
So would it be something like:
Decoder.decode(InputStream, Headers headers);
... where Headers is ...
interface Headers {
String getHeader(String headerName);
String[] getHeaders(String headerName);
... a few other accessors ...
}
?
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com