You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2022/01/17 11:37:55 UTC

[camel] 01/02: CAMEL-17485 - Camel-JSLT: Currently it could only load resources from classpath

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit a5805b0ff6b80014ca2521cbe0cb0e9ff28fa663
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jan 17 12:35:55 2022 +0100

    CAMEL-17485 - Camel-JSLT: Currently it could only load resources from classpath
---
 .../src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java b/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
index 61f1b03..1c16e01 100644
--- a/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
+++ b/components/camel-jslt/src/main/java/org/apache/camel/component/jslt/JsltEndpoint.java
@@ -43,6 +43,7 @@ import org.apache.camel.component.ResourceEndpoint;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.support.ResourceHelper;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 
@@ -101,7 +102,7 @@ public class JsltEndpoint extends ResourceEndpoint {
                 if (jsltStringFromHeader != null) {
                     parser = new Parser(new StringReader(jsltStringFromHeader)).withSource("<inline>");
                 } else {
-                    stream = getCamelContext().getClassResolver().loadResourceAsStream(getResourceUri());
+                    stream = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext(), getResourceUri());
                     if (stream == null) {
                         throw new JsltException("Cannot load resource '" + getResourceUri() + "': not found");
                     }