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-6278] Updating InputStream provider to support MessageDigestInputStream
Date Thu, 12 Mar 2015 11:31:14 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 2e15fa9c4 -> 5c0055245


[CXF-6278] Updating InputStream provider to support MessageDigestInputStream


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

Branch: refs/heads/3.0.x-fixes
Commit: 5c00552457383e4392f834412873678cda92280c
Parents: 2e15fa9
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Mar 12 11:28:57 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Mar 12 11:30:43 2015 +0000

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/5c005524/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
index 41a45eb..6394735 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/BinaryDataProvider.java
@@ -33,6 +33,7 @@ import java.io.Reader;
 import java.io.Writer;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Type;
+import java.security.DigestInputStream;
 import java.util.UUID;
 import java.util.logging.Logger;
 
@@ -44,6 +45,7 @@ import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
 
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.MessageDigestInputStream;
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxrs.impl.HttpHeadersImpl;
@@ -84,6 +86,9 @@ public class BinaryDataProvider<T> extends AbstractConfigurableProvider
         throws IOException {
         try {
             if (InputStream.class.isAssignableFrom(clazz)) {
+                if (DigestInputStream.class.isAssignableFrom(clazz)) {
+                    is = new MessageDigestInputStream(is);
+                }
                 return clazz.cast(is);
             }
             if (Reader.class.isAssignableFrom(clazz)) {


Mime
View raw message