james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1147963 - /james/mime4j/trunk/dom/src/main/java/org/apache/james/mime4j/message/MessageServiceFactoryImpl.java
Date Mon, 18 Jul 2011 16:42:09 GMT
Author: bago
Date: Mon Jul 18 16:42:09 2011
New Revision: 1147963

URL: http://svn.apache.org/viewvc?rev=1147963&view=rev
Log:
Support "DecodeMonitor" attribute in the default messageservicefactory.

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=1147963&r1=1147962&r2=1147963&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
Mon Jul 18 16:42:09 2011
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.james.mime4j.message;
 
+import org.apache.james.mime4j.codec.DecodeMonitor;
 import org.apache.james.mime4j.dom.MessageBuilder;
 import org.apache.james.mime4j.dom.MessageServiceFactory;
 import org.apache.james.mime4j.dom.MessageWriter;
@@ -35,6 +36,7 @@ public class MessageServiceFactoryImpl e
     private BodyFactory bodyFactory = null;
     private MimeConfig mimeEntityConfig = null;
     private BodyDescriptorBuilder bodyDescriptorBuilder = null;
+    private DecodeMonitor decodeMonitor = null;
     private Boolean flatMode = null;
     private Boolean contentDecoding = null;
 
@@ -46,6 +48,7 @@ public class MessageServiceFactoryImpl e
         if (bodyDescriptorBuilder != null) m.setBodyDescriptorBuilder(bodyDescriptorBuilder);
         if (flatMode != null) m.setFlatMode(flatMode.booleanValue());
         if (contentDecoding != null) m.setContentDecoding(contentDecoding.booleanValue());
+        if (decodeMonitor != null) m.setDecodeMonitor(decodeMonitor);
         return m;
     }
 
@@ -66,12 +69,17 @@ public class MessageServiceFactoryImpl e
             if (value instanceof MimeConfig) {
                 this.mimeEntityConfig = (MimeConfig) value;
                 return;
-            } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a MimeEntityConfig");
+            } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a MimeConfig");
         } else if ("MutableBodyDescriptorFactory".equals(name)) {
             if (value instanceof BodyDescriptorBuilder) {
                 this.bodyDescriptorBuilder  = (BodyDescriptorBuilder) value;
                 return;
             } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a MutableBodyDescriptorFactory");
+        } else if ("DecodeMonitor".equals(name)) {
+            if (value instanceof DecodeMonitor) {
+                this.decodeMonitor = (DecodeMonitor) value;
+                return;
+            } else throw new IllegalArgumentException("Unsupported attribute value type for
"+name+", expected a DecodeMonitor");
         } else if ("FlatMode".equals(name)) {
             if (value instanceof Boolean) {
                 this.flatMode  = (Boolean) value;



Mime
View raw message