diff -Nru Resteasy-3.0.17.Final/jaxrs/pom.xml Resteasy-3.0.17.Final.mime4j/jaxrs/pom.xml
--- Resteasy-3.0.17.Final/jaxrs/pom.xml 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/pom.xml 2016-06-06 19:38:39.158725012 +0200
@@ -448,8 +448,18 @@
org.apache.james
- apache-mime4j
- 0.6
+ apache-mime4j-core
+ 0.7.2
+
+
+ org.apache.james
+ apache-mime4j-dom
+ 0.7.2
+
+
+ org.apache.james
+ apache-mime4j-storage
+ 0.7.2
junit
diff -Nru Resteasy-3.0.17.Final/jaxrs/providers/multipart/pom.xml Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/pom.xml
--- Resteasy-3.0.17.Final/jaxrs/providers/multipart/pom.xml 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/pom.xml 2016-06-06 19:57:35.105204124 +0200
@@ -39,7 +39,15 @@
org.apache.james
- apache-mime4j
+ apache-mime4j-core
+
+
+ org.apache.james
+ apache-mime4j-dom
+
+
+ org.apache.james
+ apache-mime4j-storage
org.jboss.spec.javax.servlet
@@ -180,4 +188,4 @@
-
\ Manca newline alla fine del file
+
diff -Nru Resteasy-3.0.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java
--- Resteasy-3.0.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/i18n/Messages.java 2016-06-06 20:00:30.708859878 +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.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java
--- Resteasy-3.0.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartFormDataInputImpl.java 2016-06-06 19:41:43.414895524 +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.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java
--- Resteasy-3.0.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartInputImpl.java 2016-06-06 20:05:15.281720588 +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.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java
--- Resteasy-3.0.17.Final/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/providers/multipart/src/main/java/org/jboss/resteasy/plugins/providers/multipart/MultipartRelatedInputImpl.java 2016-06-06 19:52:58.333931717 +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.17.Final/jaxrs/security/resteasy-crypto/pom.xml Resteasy-3.0.17.Final.mime4j/jaxrs/security/resteasy-crypto/pom.xml
--- Resteasy-3.0.17.Final/jaxrs/security/resteasy-crypto/pom.xml 2016-05-17 04:37:44.000000000 +0200
+++ Resteasy-3.0.17.Final.mime4j/jaxrs/security/resteasy-crypto/pom.xml 2016-06-06 19:53:46.324378042 +0200
@@ -70,7 +70,15 @@
org.apache.james
- apache-mime4j
+ apache-mime4j-core
+
+
+ org.apache.james
+ apache-mime4j-dom
+
+
+ org.apache.james
+ apache-mime4j-storage
org.jboss.spec.javax.annotation