cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6194] Optional support for reading the content of the individual part into an explicit collection
Date Thu, 15 Jan 2015 12:19:56 GMT
Repository: cxf
Updated Branches:
  refs/heads/master eab9907c7 -> f801fab2f


[CXF-6194] Optional support for reading the content of the individual part into an explicit
collection


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/f801fab2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f801fab2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f801fab2

Branch: refs/heads/master
Commit: f801fab2f0dbfcff6333c2c71e38bc3bde78ef13
Parents: eab9907
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jan 15 12:19:36 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jan 15 12:19:36 2015 +0000

----------------------------------------------------------------------
 .../java/org/apache/cxf/jaxrs/provider/MultipartProvider.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/f801fab2/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
index 8f7c017..91e2c96 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/MultipartProvider.java
@@ -78,6 +78,7 @@ public class MultipartProvider extends AbstractConfigurableProvider
     implements MessageBodyReader<Object>, MessageBodyWriter<Object> {
     
     private static final String SUPPORT_TYPE_AS_MULTIPART = "support.type.as.multipart";
+    private static final String SINGLE_PART_IS_COLLECTION = "single.multipart.is.collection";
     private static final Logger LOG = LogUtils.getL7dLogger(MultipartProvider.class);
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(MultipartProvider.class);
     private static final Set<Class<?>> WELL_KNOWN_MULTIPART_CLASSES;
@@ -170,7 +171,9 @@ public class MultipartProvider extends AbstractConfigurableProvider
         Multipart id = AnnotationUtils.getAnnotation(anns, Multipart.class);
         Attachment multipart = AttachmentUtils.getMultipart(id, mt, infos);
         if (multipart != null) {
-            if (collectionExpected && !mediaTypeSupported(multipart.getContentType()))
{
+            if (collectionExpected 
+                && !mediaTypeSupported(multipart.getContentType())
+                && !MessageUtils.isTrue(mc.getContextualProperty(SINGLE_PART_IS_COLLECTION)))
{
                 List<Attachment> allMultiparts = AttachmentUtils.getMatchingAttachments(id,
infos);
                 return getAttachmentCollection(t, allMultiparts, anns);
             } else {


Mime
View raw message