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 10:16:11 UTC

[camel] branch main updated: CAMEL-19970 - Avoid IllegalArgumentException for file without (#11678)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 3974e969c29 CAMEL-19970 - Avoid IllegalArgumentException for file without (#11678)
3974e969c29 is described below

commit 3974e969c29b3b9a93bdd732f560eed823d321fd
Author: Aurélien Pupier <ap...@redhat.com>
AuthorDate: Tue Oct 10 12:16:04 2023 +0200

    CAMEL-19970 - Avoid IllegalArgumentException for file without (#11678)
    
    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 5446fe8ee0c..1af68230338 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
@@ -1249,6 +1249,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);