You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/10/10 13:58:15 UTC

[camel] branch camel-3.21.x updated: CAMEL-19970 - Avoid IllegalArgumentException for file without (#11683)

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

davsclaus pushed a commit to branch camel-3.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.21.x by this push:
     new b71edf0b169 CAMEL-19970 - Avoid IllegalArgumentException for file without (#11683)
b71edf0b169 is described below

commit b71edf0b169837cc18dfb3b87f6a01dda11271b6
Author: Aurélien Pupier <ap...@redhat.com>
AuthorDate: Tue Oct 10 15:58:08 2023 +0200

    CAMEL-19970 - Avoid IllegalArgumentException for file without (#11683)
    
    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 <ap...@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 1416a30c107..0c08f803ecc 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
@@ -1038,6 +1038,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);