james-mime4j-dev mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=894494&view=rev
Log:
Small refactoring to better show code duplication in MimeEntity (fix)

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=894494&r1=894493&r2=894494&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:11:59 2009
@@ -261,7 +261,7 @@
             return message;
         } else {
             BufferedLineReaderInputStream stream = new BufferedLineReaderInputStream(
-                    mimeStream, 
+                    instream, 
                     4 * 1024,
                     config.getMaxLineLen());
             MimeEntity message = new MimeEntity(
@@ -277,16 +277,16 @@
     }
     
     private EntityStateMachine nextMimeEntity() {
-    	return nextMimeEntity(EntityStates.T_START_BODYPART, EntityStates.T_END_BODYPART);
+    	return nextMimeEntity(EntityStates.T_START_BODYPART, EntityStates.T_END_BODYPART, mimeStream);
     }
     
-    private EntityStateMachine nextMimeEntity(int startState, int endState) {
+    private EntityStateMachine nextMimeEntity(int startState, int endState, InputStream instream)
{
         if (recursionMode == RecursionMode.M_RAW) {
-            RawEntity message = new RawEntity(mimeStream);
+            RawEntity message = new RawEntity(instream);
             return message;
         } else {
             BufferedLineReaderInputStream stream = new BufferedLineReaderInputStream(
-                    mimeStream, 
+            		instream, 
                     4 * 1024,
                     config.getMaxLineLen());
             MimeEntity mimeentity = new MimeEntity(



Mime
View raw message