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:42:09 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes d905b113b -> df1e1db78


[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/df1e1db7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/df1e1db7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/df1e1db7

Branch: refs/heads/2.7.x-fixes
Commit: df1e1db78a3aaa3405a482b8b02a99696fcf4c4b
Parents: d905b11
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:41:40 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/df1e1db7/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 d6779f6..b2dbd90 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 ACTIVE_JAXRS_PROVIDER_KEY = "active.jaxrs.provider";
+    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);
 
@@ -167,7 +168,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