james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r894495 - /james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
Date Tue, 29 Dec 2009 22:13:23 GMT
Author: bago
Date: Tue Dec 29 22:13:23 2009
New Revision: 894495

URL: http://svn.apache.org/viewvc?rev=894495&view=rev
Log:
Remove code duplication in MimeEntity when creating a child MimeEntity (message or part)

Modified:
    james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java

Modified: james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
URL: http://svn.apache.org/viewvc/james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java?rev=894495&r1=894494&r2=894495&view=diff
==============================================================================
--- james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
(original)
+++ james/mime4j/branches/cycleclean/core/src/main/java/org/apache/james/mime4j/parser/MimeEntity.java
Tue Dec 29 22:13:23 2009
@@ -255,25 +255,8 @@
         } else {
             instream = dataStream;
         }
-        
-        if (recursionMode == RecursionMode.M_RAW) {
-            RawEntity message = new RawEntity(instream);
-            return message;
-        } else {
-            BufferedLineReaderInputStream stream = new BufferedLineReaderInputStream(
-                    instream, 
-                    4 * 1024,
-                    config.getMaxLineLen());
-            MimeEntity message = new MimeEntity(
-                    lineSource, 
-                    stream,
-                    body, 
-                    EntityStates.T_START_MESSAGE, 
-                    EntityStates.T_END_MESSAGE,
-                    config);
-            message.setRecursionMode(recursionMode);
-            return message;
-        }
+
+        return nextMimeEntity(EntityStates.T_START_MESSAGE, EntityStates.T_END_MESSAGE, instream);
     }
     
     private EntityStateMachine nextMimeEntity() {



Mime
View raw message