You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2017/02/06 17:29:45 UTC

svn commit: r1781929 - /webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java

Author: coheigea
Date: Mon Feb  6 17:29:44 2017
New Revision: 1781929

URL: http://svn.apache.org/viewvc?rev=1781929&view=rev
Log:
Minor work to support MTOM

Modified:
    webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java

Modified: webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java?rev=1781929&r1=1781928&r2=1781929&view=diff
==============================================================================
--- webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/branches/2_1_x-fixes/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java Mon Feb  6 17:29:44 2017
@@ -533,10 +533,16 @@ public final class WSSecurityUtil {
     ) throws WSSecurityException {
         return getBytesFromAttachment(xopUri, data.getAttachmentCallbackHandler());
     }
-    
+
     public static byte[] getBytesFromAttachment(
         String xopUri, CallbackHandler attachmentCallbackHandler
     ) throws WSSecurityException {
+        return getBytesFromAttachment(xopUri, attachmentCallbackHandler, true);
+    }
+
+    public static byte[] getBytesFromAttachment(
+        String xopUri, CallbackHandler attachmentCallbackHandler, boolean removeAttachments
+    ) throws WSSecurityException {
         if (attachmentCallbackHandler == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK);
         }
@@ -553,6 +559,7 @@ public final class WSSecurityUtil {
 
         AttachmentRequestCallback attachmentRequestCallback = new AttachmentRequestCallback();
         attachmentRequestCallback.setAttachmentId(attachmentId);
+        attachmentRequestCallback.setRemoveAttachments(removeAttachments);
 
         try {
             attachmentCallbackHandler.handle(new Callback[]{attachmentRequestCallback});