james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1611279 - in /james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message: DefaultMessageBuilder.java EntityBuilder.java MessageBuilder.java ParserStreamContentHandler.java
Date Thu, 17 Jul 2014 08:08:07 GMT
Author: olegk
Date: Thu Jul 17 08:08:07 2014
New Revision: 1611279

URL: http://svn.apache.org/r1611279
Log:
EntityBuilder -> /ParserStreamContentHandler; minor cleanups

Added:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
  (contents, props changed)
      - copied, changed from r1611278, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
Removed:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
Modified:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageBuilder.java
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageBuilder.java?rev=1611279&r1=1611278&r2=1611279&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/DefaultMessageBuilder.java
Thu Jul 17 08:08:07 2014
@@ -304,9 +304,7 @@ public class DefaultMessageBuilder imple
                     strict ? DefaultFieldParser.getParser() : LenientFieldParser.getParser(),
mon);
             BodyFactory bf = bodyFactory != null ? bodyFactory : new BasicBodyFactory();
             MimeStreamParser parser = new MimeStreamParser(cfg, mon, bdb);
-            // EntityBuilder expect the parser will send ParserFields for the well known
fields
-            // It will throw exceptions, otherwise.
-            parser.setContentHandler(new EntityBuilder(message, bf));
+            parser.setContentHandler(new ParserStreamContentHandler(message, bf));
             parser.setContentDecoding(contentDecoding);
             if (flatMode) {
                 parser.setFlat();

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java?rev=1611279&r1=1611278&r2=1611279&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageBuilder.java
Thu Jul 17 08:08:07 2014
@@ -881,7 +881,7 @@ public class MessageBuilder extends Abst
         MimeStreamParser parser = new MimeStreamParser(currentConfig, currentMonitor, currentBodyDescBuilder);
 
         Message message = new MessageImpl();
-        parser.setContentHandler(new EntityBuilder(message, currentBodyFactory));
+        parser.setContentHandler(new ParserStreamContentHandler(message, currentBodyFactory));
         parser.setContentDecoding(!rawContent);
         if (flatMode) {
             parser.setFlat();

Copied: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
(from r1611278, james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java)
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java?p2=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java&p1=james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java&r1=1611278&r2=1611279&rev=1611279&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/EntityBuilder.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
Thu Jul 17 08:08:07 2014
@@ -39,14 +39,14 @@ import java.util.Stack;
  * A <code>ContentHandler</code> for building an <code>Entity</code>
to be
  * used in conjunction with a {@link org.apache.james.mime4j.parser.MimeStreamParser}.
  */
-class EntityBuilder implements ContentHandler {
+class ParserStreamContentHandler implements ContentHandler {
 
     private final Entity entity;
-    private MessageImplFactory messageImplFactory;
+    private final MessageImplFactory messageImplFactory;
     private final BodyFactory bodyFactory;
     private final Stack<Object> stack;
 
-    EntityBuilder(
+    ParserStreamContentHandler(
             final Entity entity,
             final BodyFactory bodyFactory) {
         this.entity = entity;
@@ -55,7 +55,7 @@ class EntityBuilder implements ContentHa
         this.stack = new Stack<Object>();
     }
 
-    EntityBuilder(
+    ParserStreamContentHandler(
             final Entity entity,
             final MessageImplFactory messageImplFactory,
             final BodyFactory bodyFactory) {
@@ -118,25 +118,7 @@ class EntityBuilder implements ContentHa
     public void body(BodyDescriptor bd, final InputStream is) throws MimeException, IOException
{
         expect(Entity.class);
 
-        // NO NEED TO MANUALLY RUN DECODING.
-        // The parser has a "setContentDecoding" method. We should
-        // simply instantiate the MimeStreamParser with that method.
-
-        // final String enc = bd.getTransferEncoding();
-
         final Body body;
-
-        /*
-        final InputStream decodedStream;
-        if (MimeUtil.ENC_BASE64.equals(enc)) {
-            decodedStream = new Base64InputStream(is);
-        } else if (MimeUtil.ENC_QUOTED_PRINTABLE.equals(enc)) {
-            decodedStream = new QuotedPrintableInputStream(is);
-        } else {
-            decodedStream = is;
-        }
-        */
-
         if (bd.getMimeType().startsWith("text/")) {
             body = bodyFactory.textBody(is, bd.getCharset());
         } else {

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/ParserStreamContentHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message