diff -Nru Resteasy-3.0.19.Final/jaxrs/pom.xml Resteasy-3.0.19.Final.mime4j/jaxrs/pom.xml
--- Resteasy-3.0.19.Final/jaxrs/pom.xml	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/pom.xml	2016-08-21 13:34:08.110158700 +0200
@@ -456,8 +456,18 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.james</groupId>
-                <artifactId>apache-mime4j</artifactId>
-                <version>0.6</version>
+                <artifactId>apache-mime4j-core</artifactId>
+                <version>0.7.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>apache-mime4j-dom</artifactId>
+                <version>0.7.2</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.james</groupId>
+                <artifactId>apache-mime4j-storage</artifactId>
+                <version>0.7.2</version>
             </dependency>
             <dependency>
                 <groupId>junit</groupId>
diff -Nru Resteasy-3.0.19.Final/jaxrs/providers/multipart/pom.xml Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/pom.xml
--- Resteasy-3.0.19.Final/jaxrs/providers/multipart/pom.xml	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/pom.xml	2016-08-21 13:34:08.110158700 +0200
@@ -39,7 +39,15 @@
         </dependency>
         <dependency>
             <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j</artifactId>
+            <artifactId>apache-mime4j-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-dom</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-storage</artifactId>
         </dependency>
         <dependency>
             <groupId>org.jboss.spec.javax.servlet</groupId>
@@ -180,4 +188,4 @@
             </build>
         </profile>
     </profiles>
-</project>
\ Manca newline alla fine del file
+</project>
diff -Nru Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java
--- Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java	2016-08-21 13:34:08.111158649 +0200
@@ -5,7 +5,7 @@
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.ext.MessageBodyReader;
 
-import org.apache.james.mime4j.parser.Field;
+import org.apache.james.mime4j.stream.Field;
 import org.jboss.logging.annotations.Message;
 import org.jboss.logging.annotations.Message.Format;
 import org.jboss.logging.annotations.MessageBundle;
diff -Nru Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java
--- Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java	2016-08-21 13:34:08.112158597 +0200
@@ -1,9 +1,9 @@
 package org.jboss.resteasy.plugins.providers.multipart;
 
-import org.apache.james.mime4j.field.ContentDispositionField;
-import org.apache.james.mime4j.field.FieldName;
+import org.apache.james.mime4j.dom.field.ContentDispositionField;
+import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.message.BodyPart;
-import org.apache.james.mime4j.parser.Field;
+import org.apache.james.mime4j.stream.Field;
 import org.jboss.resteasy.plugins.providers.multipart.i18n.Messages;
 
 import javax.ws.rs.core.GenericType;
diff -Nru Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java
--- Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java	2016-08-21 13:34:08.113158546 +0200
@@ -4,22 +4,22 @@
 import org.apache.james.mime4j.MimeIOException;
 import org.apache.james.mime4j.codec.Base64InputStream;
 import org.apache.james.mime4j.codec.QuotedPrintableInputStream;
-import org.apache.james.mime4j.descriptor.BodyDescriptor;
-import org.apache.james.mime4j.field.ContentTypeField;
-import org.apache.james.mime4j.message.BinaryBody;
-import org.apache.james.mime4j.message.Body;
+import org.apache.james.mime4j.dom.BinaryBody;
+import org.apache.james.mime4j.dom.Body;
+import org.apache.james.mime4j.dom.Entity;
+import org.apache.james.mime4j.dom.Message;
+import org.apache.james.mime4j.dom.Multipart;
+import org.apache.james.mime4j.dom.TextBody;
+import org.apache.james.mime4j.dom.MessageBuilder;
+import org.apache.james.mime4j.dom.MessageServiceFactory;
+import org.apache.james.mime4j.dom.field.ContentTypeField;
+import org.apache.james.mime4j.message.MessageImpl;
 import org.apache.james.mime4j.message.BodyFactory;
 import org.apache.james.mime4j.message.BodyPart;
-import org.apache.james.mime4j.message.Entity;
-import org.apache.james.mime4j.message.Message;
-import org.apache.james.mime4j.message.MessageBuilder;
-import org.apache.james.mime4j.message.Multipart;
-import org.apache.james.mime4j.message.TextBody;
-import org.apache.james.mime4j.parser.Field;
+import org.apache.james.mime4j.parser.AbstractContentHandler;
 import org.apache.james.mime4j.parser.MimeStreamParser;
-import org.apache.james.mime4j.storage.DefaultStorageProvider;
-import org.apache.james.mime4j.storage.StorageProvider;
-import org.apache.james.mime4j.util.CharsetUtil;
+import org.apache.james.mime4j.stream.BodyDescriptor;
+import org.apache.james.mime4j.stream.Field;
 import org.apache.james.mime4j.util.MimeUtil;
 import org.jboss.resteasy.core.ProvidersContextRetainer;
 import org.jboss.resteasy.plugins.providers.multipart.i18n.Messages;
@@ -47,6 +47,7 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.util.ArrayList;
+import java.nio.charset.Charset;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -69,7 +70,7 @@
    protected Providers savedProviders;
 
    // We hack MIME4j so that it always returns a BinaryBody so we don't have to deal with Readers and their charset conversions
-   private static class BinaryOnlyMessageBuilder extends MessageBuilder
+   private static class BinaryOnlyMessageBuilder extends AbstractContentHandler
    {
       private Method expectMethod;
       private java.lang.reflect.Field bodyFactoryField;
@@ -92,18 +93,6 @@
          }
       }
 
-      private BinaryOnlyMessageBuilder(Entity entity)
-      {
-         super(entity);
-         init();
-      }
-
-      private BinaryOnlyMessageBuilder(Entity entity, StorageProvider storageProvider)
-      {
-         super(entity, storageProvider);
-         init();
-      }
-
       @Override
       public void body(BodyDescriptor bd, InputStream is) throws MimeException, IOException
       {
@@ -147,13 +136,13 @@
       }
    }
 
-   private static class BinaryMessage extends Message
+   private static class BinaryMessage extends MessageImpl
    {
       private BinaryMessage(InputStream is) throws IOException, MimeIOException
       {
          try {
-            MimeStreamParser parser = new MimeStreamParser(null);
-            parser.setContentHandler(new BinaryOnlyMessageBuilder(this, DefaultStorageProvider.getInstance()));
+            MimeStreamParser parser = new MimeStreamParser();
+            parser.setContentHandler(new BinaryOnlyMessageBuilder());
             parser.parse(is);
          } catch (MimeException e) {
             throw new MimeIOException(e);
@@ -198,15 +187,21 @@
    
    public MultipartInputImpl(Multipart multipart, Providers workers) throws IOException
    {
-      for (BodyPart bodyPart : multipart.getBodyParts())
-         parts.add(extractPart(bodyPart));
+      for (Entity bodyPart : multipart.getBodyParts())
+         parts.add(extractPart((BodyPart) bodyPart));
       this.workers = workers;
    }
 
    public void parse(InputStream is) throws IOException
    {
-      mimeMessage = new BinaryMessage(addHeaderToHeadlessStream(is));
-      extractParts();
+      try {
+         MessageServiceFactory factory = MessageServiceFactory.newInstance();
+         MessageBuilder builder = factory.newMessageBuilder();
+         mimeMessage = builder.parseMessage(addHeaderToHeadlessStream(is));
+         extractParts();
+      } catch (MimeException e) {
+         throw new IOException("Couldn't parse message", e);
+      }
    }
 
    protected InputStream addHeaderToHeadlessStream(InputStream is)
@@ -236,8 +231,8 @@
    protected void extractParts() throws IOException
    {
       Multipart multipart = (Multipart) mimeMessage.getBody();
-      for (BodyPart bodyPart : multipart.getBodyParts())
-         parts.add(extractPart(bodyPart));
+      for (Entity bodyPart : multipart.getBodyParts())
+        parts.add(extractPart((BodyPart) bodyPart));
    }
 
    protected InputPart extractPart(BodyPart bodyPart) throws IOException
diff -Nru Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java
--- Resteasy-3.0.19.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java	2016-08-21 13:34:08.114158495 +0200
@@ -1,7 +1,7 @@
 package org.jboss.resteasy.plugins.providers.multipart;
 
-import org.apache.james.mime4j.field.ContentTypeField;
-import org.apache.james.mime4j.field.FieldName;
+import org.apache.james.mime4j.dom.field.ContentTypeField;
+import org.apache.james.mime4j.dom.field.FieldName;
 import org.apache.james.mime4j.message.BodyPart;
 
 import javax.ws.rs.core.MediaType;
diff -Nru Resteasy-3.0.19.Final/jaxrs/security/resteasy-crypto/pom.xml Resteasy-3.0.19.Final.mime4j/jaxrs/security/resteasy-crypto/pom.xml
--- Resteasy-3.0.19.Final/jaxrs/security/resteasy-crypto/pom.xml	2016-08-02 16:26:27.000000000 +0200
+++ Resteasy-3.0.19.Final.mime4j/jaxrs/security/resteasy-crypto/pom.xml	2016-08-21 13:34:08.115158443 +0200
@@ -70,7 +70,15 @@
         </dependency>
         <dependency>
             <groupId>org.apache.james</groupId>
-            <artifactId>apache-mime4j</artifactId>
+            <artifactId>apache-mime4j-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-dom</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.james</groupId>
+            <artifactId>apache-mime4j-storage</artifactId>
         </dependency>
         <dependency>
             <groupId>org.jboss.spec.javax.annotation</groupId>
