james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1094132 - /james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java
Date Sun, 17 Apr 2011 11:46:41 GMT
Author: olegk
Date: Sun Apr 17 11:46:40 2011
New Revision: 1094132

URL: http://svn.apache.org/viewvc?rev=1094132&view=rev
Log:
MIME4J-192: added FlatMode and ContentDecoding parameters

Modified:
    james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java

Modified: james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java?rev=1094132&r1=1094131&r2=1094132&view=diff
==============================================================================
--- james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java
(original)
+++ james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java
Sun Apr 17 11:46:40 2011
@@ -35,6 +35,8 @@ public class MessageServiceFactoryImpl e
     private BodyFactory bodyFactory = null;
     private MimeEntityConfig mimeEntityConfig = null;
     private MutableBodyDescriptorFactory mutableBodyDescriptorFactory = null;
+    private Boolean flatMode = null;
+    private Boolean contentDecoding = null;
 
     @Override
     public MessageBuilder newMessageBuilder() {
@@ -42,6 +44,8 @@ public class MessageServiceFactoryImpl e
         if (bodyFactory != null) m.setBodyFactory(bodyFactory);
         if (mimeEntityConfig != null) m.setMimeEntityConfig(mimeEntityConfig);
         if (mutableBodyDescriptorFactory != null) m.setMutableBodyDescriptorFactory(mutableBodyDescriptorFactory);
+        if (flatMode != null) m.setFlatMode(flatMode.booleanValue());
+        if (contentDecoding != null) m.setContentDecoding(contentDecoding.booleanValue());
         return m;
     }
 
@@ -69,6 +73,16 @@ public class MessageServiceFactoryImpl e
                 this.mutableBodyDescriptorFactory  = (MutableBodyDescriptorFactory) value;
                 return;
             } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a MutableBodyDescriptorFactory");
+        } else if ("FlatMode".equals(name)) {
+            if (value instanceof Boolean) {
+                this.flatMode  = (Boolean) value;
+                return;
+            } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a Boolean");
+        } else if ("ContentDecoding".equals(name)) {
+            if (value instanceof Boolean) {
+                this.contentDecoding = (Boolean) value;
+                return;
+            } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a Boolean");
         }
             
         throw new IllegalArgumentException("Unsupported attribute: "+name);



Mime
View raw message