This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-4.0.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-4.0.x by this push: new 4c47e75e2d2 CAMEL-19970 - Avoid IllegalArgumentException for file without (#11685) 4c47e75e2d2 is described below commit 4c47e75e2d25c49f2f879827f491cca1a4451b9b Author: Aurélien Pupier <apup...@redhat.com> AuthorDate: Tue Oct 10 12:16:19 2023 +0200 CAMEL-19970 - Avoid IllegalArgumentException for file without (#11685) extension in same folder when using JBang and that we let auto-detect routes, the files without extensions were added as potential routes and, as expected, no RouteLoader were found. An IllegalArgumentExeption was thrown at this time. Signed-off-by: Aurélien Pupier <apup...@redhat.com> --- .../src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java index 7e2fcc6e55d..15e571e3cfd 100644 --- a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java +++ b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java @@ -1121,6 +1121,10 @@ public class Run extends CamelCommand { if (f.exists() && f.isDirectory()) { return true; } + + if (FileUtil.onlyExt(name) == null) { + return true; + } String on = FileUtil.onlyName(name, true); on = on.toLowerCase(Locale.ROOT);