You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2013/09/11 11:38:24 UTC

[2/4] git commit: CAMEL-6727 Close the stream in XmlSignerHelper.getXslTransform with thanks to Franz

CAMEL-6727 Close the stream in XmlSignerHelper.getXslTransform with thanks to Franz


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

Branch: refs/heads/master
Commit: ae6a4c08152b22a4b6177c4dad5dcbd6008a810b
Parents: 95e17f6
Author: Willem Jiang <ni...@apache.org>
Authored: Wed Sep 11 17:04:06 2013 +0800
Committer: Willem Jiang <ni...@apache.org>
Committed: Wed Sep 11 17:04:06 2013 +0800

----------------------------------------------------------------------
 .../camel/component/xmlsecurity/api/XmlSignatureHelper.java   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ae6a4c08/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java
----------------------------------------------------------------------
diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java
index 575f82b..851aeb5 100644
--- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java
+++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/api/XmlSignatureHelper.java
@@ -52,6 +52,7 @@ import javax.xml.xpath.XPathExpression;
 import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xpath.XPathFactory;
 
+import org.apache.camel.util.IOHelper;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -330,7 +331,11 @@ public final class XmlSignatureHelper {
         if (is == null) {
             throw new IllegalStateException(String.format("XSL file %s not found", path));
         }
-        return getXslTranform(is);
+        try{
+        	return getXslTranform(is);
+        }finally{
+        	IOHelper.close(is);
+        }
     }
 
     /**