[
https://issues.apache.org/jira/browse/CAMEL-25982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143968#comment-18143968
]
Claus Ibsen commented on CAMEL-25982:
-------------------------------------
Revised proposal, after discussing it: the portable form of the name is the one
without a scheme. {{camel run}} puts the files given on the command line on the
classpath, and {{camel export}} puts them in {{src/main/resources}}, so
{{resource:order.json}} works in both without changing it from {{file:}} to
{{classpath:}} later.
So with {{resolveResource=true}}:
* a result {{resource:<name>}} without a scheme is loaded from the classpath,
as today;
* a result whose name has a scheme ({{file:}}, {{http:}}, {{ref:}}, {{bean:}}
...) or contains {{..}} fails, with an error that says to give the name without
a scheme;
* the docs of the option say to write names without a scheme, and that the name
should come from the route (a fixed prefix with a name the route chooses), not
straight from the message;
* upgrade guide 4.24: results with {{resource:file:...}} drop the {{file:}}.
_Claude Code on behalf of davsclaus_
> camel-core - resolveResource: limit the resources an expression result may
> load, and say where the name should come from
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25982
> URL: https://issues.apache.org/jira/browse/CAMEL-25982
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Priority: Major
> Fix For: 4.24.0
>
>
> The {{resolveResource}} option of the expressions (CAMEL-24884, 4.23.0) loads
> a result that starts with {{resource:}} and gives its content instead
> ({{ExpressionReifier.resolveResourceResult}}, main e6885df7894d, lines
> 176-177 and 192). Any scheme the resource loader knows can be loaded, from
> any location.
> Proposal:
> * an option that limits what such a result may load: the schemes it may use,
> {{classpath:}} by default, and for {{file:}} a base directory the file must
> be in;
> * say in the docs of the option that the name of the resource should come
> from the route, such as a fixed prefix with a template name the route
> chooses, and not straight from the content of the message.
> _Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)