[
https://issues.apache.org/jira/browse/MIME4J-22?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524584
]
Stefano Bagnara commented on MIME4J-22:
---------------------------------------
In MimeTokenStream you added
+ /**
+ * Creates a new instance of [EMAIL PROTECTED] BodyDescriptor}. Subclasses
may override
+ * this in order to create body descriptors, that provide more specific
+ * information.
+ */
+ protected DefaultBodyDescriptor newBodyDescriptor(BodyDescriptor pParent) {
+ return new DefaultBodyDescriptor(pParent);
+ }
The return value should be "BodyDescriptor" and not the implementation or the
comment won't apply.
In SimpleContentHandler you removed the following code:
/**
* Abstract implementation of ContentHandler that automates common
* tasks. Currently performs header parsing and applies content-transfer
@@ -87,14 +85,6 @@
* @see
org.apache.james.mime4j.AbstractContentHandler#body(org.apache.james.mime4j.BodyDescriptor,
java.io.InputStream)
*/
public final void body(BodyDescriptor bd, InputStream is) throws
IOException {
- if (bd.isBase64Encoded()) {
- bodyDecoded(bd, new Base64InputStream(is));
- }
- else if (bd.isQuotedPrintableEncoded()) {
- bodyDecoded(bd, new QuotedPrintableInputStream(is));
- }
- else {
- bodyDecoded(bd, is);
- }
+ bodyDecoded(bd, is);
}
Can you explain why did you remove the bodyDecoding streams?
> [JW#2]
> -------
>
> Key: MIME4J-22
> URL: https://issues.apache.org/jira/browse/MIME4J-22
> Project: Mime4j
> Issue Type: Wish
> Reporter: Robert Burrell Donkin
> Attachments: mime4j-pluggable-body-descriptor.patch
>
>
> http://mail-archives.apache.org/mod_mbox/james-server-dev/200708.mbox/[EMAIL
> PROTECTED] number 2
> 2.) Let BodyDescriptor provide full blown access to the headers
> Currently, BodyDescriptor offers access to the content-type and
> content-transfer-encoding headers only.
> As a consequence, the mime4j user is forced to listen for T_FIELD events
> and build its own header map. This is duplicated work, in
> particular, because
> all mime4j users will likely do the same.
> I'd propose to:
> - Replace BodyDescriptor with an interface. (Assumes that this
> is possible,
> I am guessing by the version number 0.4, but I maybe wrong.)
> - Make the BodyDescriptor implementation pluggable by adding a method
> protected void newBodyDescriptor()
> to the Mime4JTokenStream.
> - Provide a default implementation that maintains a map of headers and
> values.
> - Open up the method
> private void getHeaderParams(String)
> by making it static and moving it to a utility class or by
> providing an accessor
> that takes a header name as an argument and invokes the
> method by providing
> the value as input.
> - Rename getParameters() to getContentTypeParameters(),
> because the method
> name is definitely confusing. I clearly had the impression
> that this method would
> provide the header values.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]