This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new fc8a667 Close InputStreams after usage. (#4975)
fc8a667 is described below
commit fc8a667cb3d631f9458d313756e97c372e2e412d
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Feb 1 18:38:49 2021 +0100
Close InputStreams after usage. (#4975)
---
.../apache/camel/component/validator/DefaultLSResourceResolver.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git
a/components/camel-validator/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
b/components/camel-validator/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
index 7615979..287e666 100644
---
a/components/camel-validator/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
+++
b/components/camel-validator/src/main/java/org/apache/camel/component/validator/DefaultLSResourceResolver.java
@@ -29,6 +29,7 @@ import org.apache.camel.CamelContext;
import org.apache.camel.RuntimeCamelException;
import org.apache.camel.support.ResourceHelper;
import org.apache.camel.util.FileUtil;
+import org.apache.camel.util.IOHelper;
import org.apache.camel.util.ObjectHelper;
/**
@@ -107,7 +108,9 @@ public class DefaultLSResourceResolver implements
LSResourceResolver {
private String getInputUri() {
// find the xsd with relative path
if (ObjectHelper.isNotEmpty(relatedURI)) {
- try
(ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext,
relatedURI)) {
+ try {
+ InputStream is =
ResourceHelper.resolveMandatoryResourceAsInputStream(camelContext, relatedURI);
+ IOHelper.close(is);
return relatedURI;
} catch (IOException e) {
// ignore the exception