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 0165a54695e CAMEL-19778: camel-jbang - Add DSL transform command
0165a54695e is described below
commit 0165a54695e59d85e53fa50af40d9ac67413eb66
Author: Claus Ibsen <[email protected]>
AuthorDate: Fri Aug 25 07:39:56 2023 +0200
CAMEL-19778: camel-jbang - Add DSL transform command
---
.../org/apache/camel/spi/DumpRoutesStrategy.java | 11 ++--
.../impl/DefaultDumpRoutesStrategyConfigurer.java | 12 ++---
.../camel/impl/DefaultDumpRoutesStrategy.java | 62 +++++++++++++++-------
.../MainConfigurationPropertiesConfigurer.java | 12 ++---
.../camel-main-configuration-metadata.json | 2 +-
core/camel-main/src/main/docs/main.adoc | 2 +-
.../camel/main/DefaultConfigurationConfigurer.java | 2 +-
.../camel/main/DefaultConfigurationProperties.java | 28 ++++++----
.../mbean/ManagedDumpRoutesStrategyMBean.java | 8 +--
.../management/mbean/ManagedDumpRouteStrategy.java | 8 +--
.../management/ManagedRouteDumpStrategyTest.java | 2 +-
.../camel/dsl/jbang/core/commands/Transform.java | 7 ++-
12 files changed, 93 insertions(+), 63 deletions(-)
diff --git
a/core/camel-api/src/main/java/org/apache/camel/spi/DumpRoutesStrategy.java
b/core/camel-api/src/main/java/org/apache/camel/spi/DumpRoutesStrategy.java
index 6372591b996..7143fc5f08d 100644
--- a/core/camel-api/src/main/java/org/apache/camel/spi/DumpRoutesStrategy.java
+++ b/core/camel-api/src/main/java/org/apache/camel/spi/DumpRoutesStrategy.java
@@ -74,12 +74,15 @@ public interface DumpRoutesStrategy extends StaticService {
*/
void setLog(boolean log);
- String getDirectory();
+ String getOutput();
/**
- * Whether to save route dumps to files in the given directory. The name
of the files are based on original loaded
- * resource, or an autogenerated name.
+ * Whether to save route dumps to an output file.
+ *
+ * If the output is a filename, then all content is saved to this file. If
the output is a directory name, then one
+ * or more files are saved to the directory, where the names are based on
the original source file names, or auto
+ * generated names.
*/
- void setDirectory(String directory);
+ void setOutput(String output);
}
diff --git
a/core/camel-core-engine/src/generated/java/org/apache/camel/impl/DefaultDumpRoutesStrategyConfigurer.java
b/core/camel-core-engine/src/generated/java/org/apache/camel/impl/DefaultDumpRoutesStrategyConfigurer.java
index fabccd51adb..fa54693f7f7 100644
---
a/core/camel-core-engine/src/generated/java/org/apache/camel/impl/DefaultDumpRoutesStrategyConfigurer.java
+++
b/core/camel-core-engine/src/generated/java/org/apache/camel/impl/DefaultDumpRoutesStrategyConfigurer.java
@@ -23,14 +23,14 @@ public class DefaultDumpRoutesStrategyConfigurer extends
org.apache.camel.suppor
switch (ignoreCase ? name.toLowerCase() : name) {
case "camelcontext":
case "CamelContext": target.setCamelContext(property(camelContext,
org.apache.camel.CamelContext.class, value)); return true;
- case "directory":
- case "Directory": target.setDirectory(property(camelContext,
java.lang.String.class, value)); return true;
case "generatedids":
case "GeneratedIds": target.setGeneratedIds(property(camelContext,
boolean.class, value)); return true;
case "include":
case "Include": target.setInclude(property(camelContext,
java.lang.String.class, value)); return true;
case "log":
case "Log": target.setLog(property(camelContext, boolean.class,
value)); return true;
+ case "output":
+ case "Output": target.setOutput(property(camelContext,
java.lang.String.class, value)); return true;
case "resolveplaceholders":
case "ResolvePlaceholders":
target.setResolvePlaceholders(property(camelContext, boolean.class, value));
return true;
case "uriasparameters":
@@ -44,14 +44,14 @@ public class DefaultDumpRoutesStrategyConfigurer extends
org.apache.camel.suppor
switch (ignoreCase ? name.toLowerCase() : name) {
case "camelcontext":
case "CamelContext": return org.apache.camel.CamelContext.class;
- case "directory":
- case "Directory": return java.lang.String.class;
case "generatedids":
case "GeneratedIds": return boolean.class;
case "include":
case "Include": return java.lang.String.class;
case "log":
case "Log": return boolean.class;
+ case "output":
+ case "Output": return java.lang.String.class;
case "resolveplaceholders":
case "ResolvePlaceholders": return boolean.class;
case "uriasparameters":
@@ -66,14 +66,14 @@ public class DefaultDumpRoutesStrategyConfigurer extends
org.apache.camel.suppor
switch (ignoreCase ? name.toLowerCase() : name) {
case "camelcontext":
case "CamelContext": return target.getCamelContext();
- case "directory":
- case "Directory": return target.getDirectory();
case "generatedids":
case "GeneratedIds": return target.isGeneratedIds();
case "include":
case "Include": return target.getInclude();
case "log":
case "Log": return target.isLog();
+ case "output":
+ case "Output": return target.getOutput();
case "resolveplaceholders":
case "ResolvePlaceholders": return target.isResolvePlaceholders();
case "uriasparameters":
diff --git
a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultDumpRoutesStrategy.java
b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultDumpRoutesStrategy.java
index 88b0e1f09ca..816d82b1f56 100644
---
a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultDumpRoutesStrategy.java
+++
b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultDumpRoutesStrategy.java
@@ -74,7 +74,8 @@ public class DefaultDumpRoutesStrategy extends ServiceSupport
implements DumpRou
private boolean uriAsParameters;
private boolean generatedIds = true;
private boolean log = true;
- private String directory;
+ private String output;
+ private String outputFileName;
@Override
public CamelContext getCamelContext() {
@@ -86,6 +87,19 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
this.camelContext = camelContext;
}
+ @Override
+ protected void doStart() throws Exception {
+ // output can be a filename, dir, or both
+ String name = FileUtil.stripPath(output);
+ if (name != null && name.contains(".")) {
+ outputFileName = name;
+ output = FileUtil.onlyPath(output);
+ if (output == null || output.isEmpty()) {
+ output = ".";
+ }
+ }
+ }
+
public String getInclude() {
return include;
}
@@ -118,12 +132,12 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
this.log = log;
}
- public String getDirectory() {
- return directory;
+ public String getOutput() {
+ return output;
}
- public void setDirectory(String directory) {
- this.directory = directory;
+ public void setOutput(String output) {
+ this.output = output;
}
public boolean isUriAsParameters() {
@@ -489,7 +503,7 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
}
}
- if (directory != null && !files.isEmpty()) {
+ if (output != null && !files.isEmpty()) {
// all XML files need to have <camel> as root tag
doAdjustXmlFiles(files);
}
@@ -527,23 +541,14 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
}
protected void doDumpToDirectory(Resource resource, StringBuilder sbLocal,
String kind, String ext, Set<String> files) {
- if (directory != null && !sbLocal.isEmpty()) {
+ if (output != null && !sbLocal.isEmpty()) {
// make sure directory exists
- File dir = new File(directory);
+ File dir = new File(output);
dir.mkdirs();
- String name = resource != null ? resource.getLocation() : null;
- if (name == null) {
- name = "dump" + counter.incrementAndGet();
- }
- // strip scheme
- if (name.contains(":")) {
- name = StringHelper.after(name, ":");
- }
-
- name = FileUtil.onlyName(name) + "." + ext;
+ String name = resolveFileName(ext, resource);
boolean newFile = files.isEmpty() || !files.contains(name);
- File target = new File(directory, name);
+ File target = new File(output, name);
try {
if (newFile) {
// write as new file (override old file if exists)
@@ -564,7 +569,7 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
for (String name : files) {
if (name.endsWith(".xml")) {
try {
- File file = new File(directory, name);
+ File file = new File(output, name);
// wrap xml files with <camel> root tag
StringBuilder sb = new StringBuilder();
sb.append("<camel>\n\n");
@@ -625,4 +630,21 @@ public class DefaultDumpRoutesStrategy extends
ServiceSupport implements DumpRou
return loc;
}
+ protected String resolveFileName(String ext, Resource resource) {
+ if (outputFileName != null) {
+ return outputFileName;
+ }
+
+ // compute name from resource or auto-generated
+ String name = resource != null ? resource.getLocation() : null;
+ if (name == null) {
+ name = "dump" + counter.incrementAndGet();
+ }
+ // strip scheme
+ if (name.contains(":")) {
+ name = StringHelper.after(name, ":");
+ }
+ return FileUtil.onlyName(name) + "." + ext;
+ }
+
}
diff --git
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
index 0bc0b781c4e..c8a783e0e9e 100644
---
a/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
+++
b/core/camel-main/src/generated/java/org/apache/camel/main/MainConfigurationPropertiesConfigurer.java
@@ -73,14 +73,14 @@ public class MainConfigurationPropertiesConfigurer extends
org.apache.camel.supp
case "DevConsoleEnabled":
target.setDevConsoleEnabled(property(camelContext, boolean.class, value));
return true;
case "dumproutes":
case "DumpRoutes": target.setDumpRoutes(property(camelContext,
java.lang.String.class, value)); return true;
- case "dumproutesdirectory":
- case "DumpRoutesDirectory":
target.setDumpRoutesDirectory(property(camelContext, java.lang.String.class,
value)); return true;
case "dumproutesgeneratedids":
case "DumpRoutesGeneratedIds":
target.setDumpRoutesGeneratedIds(property(camelContext, boolean.class, value));
return true;
case "dumproutesinclude":
case "DumpRoutesInclude":
target.setDumpRoutesInclude(property(camelContext, java.lang.String.class,
value)); return true;
case "dumprouteslog":
case "DumpRoutesLog": target.setDumpRoutesLog(property(camelContext,
boolean.class, value)); return true;
+ case "dumproutesoutput":
+ case "DumpRoutesOutput":
target.setDumpRoutesOutput(property(camelContext, java.lang.String.class,
value)); return true;
case "dumproutesresolveplaceholders":
case "DumpRoutesResolvePlaceholders":
target.setDumpRoutesResolvePlaceholders(property(camelContext, boolean.class,
value)); return true;
case "dumproutesuriasparameters":
@@ -332,14 +332,14 @@ public class MainConfigurationPropertiesConfigurer
extends org.apache.camel.supp
case "DevConsoleEnabled": return boolean.class;
case "dumproutes":
case "DumpRoutes": return java.lang.String.class;
- case "dumproutesdirectory":
- case "DumpRoutesDirectory": return java.lang.String.class;
case "dumproutesgeneratedids":
case "DumpRoutesGeneratedIds": return boolean.class;
case "dumproutesinclude":
case "DumpRoutesInclude": return java.lang.String.class;
case "dumprouteslog":
case "DumpRoutesLog": return boolean.class;
+ case "dumproutesoutput":
+ case "DumpRoutesOutput": return java.lang.String.class;
case "dumproutesresolveplaceholders":
case "DumpRoutesResolvePlaceholders": return boolean.class;
case "dumproutesuriasparameters":
@@ -592,14 +592,14 @@ public class MainConfigurationPropertiesConfigurer
extends org.apache.camel.supp
case "DevConsoleEnabled": return target.isDevConsoleEnabled();
case "dumproutes":
case "DumpRoutes": return target.getDumpRoutes();
- case "dumproutesdirectory":
- case "DumpRoutesDirectory": return target.getDumpRoutesDirectory();
case "dumproutesgeneratedids":
case "DumpRoutesGeneratedIds": return
target.isDumpRoutesGeneratedIds();
case "dumproutesinclude":
case "DumpRoutesInclude": return target.getDumpRoutesInclude();
case "dumprouteslog":
case "DumpRoutesLog": return target.isDumpRoutesLog();
+ case "dumproutesoutput":
+ case "DumpRoutesOutput": return target.getDumpRoutesOutput();
case "dumproutesresolveplaceholders":
case "DumpRoutesResolvePlaceholders": return
target.isDumpRoutesResolvePlaceholders();
case "dumproutesuriasparameters":
diff --git
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
index e8028acc780..1ccdccd98d9 100644
---
a/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
+++
b/core/camel-main/src/generated/resources/META-INF/camel-main-configuration-metadata.json
@@ -39,10 +39,10 @@
{ "name": "camel.main.description", "description": "Sets the description
(intended for humans) of the Camel application.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String" },
{ "name": "camel.main.devConsoleEnabled", "description": "Whether to
enable developer console (requires camel-console on classpath). The developer
console is only for assisting during development. This is NOT for production
usage.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties",
"type": "boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.main.dumpRoutes", "description": "If dumping is enabled
then Camel will during startup dump all loaded routes (incl rests and route
templates) represented as XML\/YAML DSL into the log. This is intended for
trouble shooting or to assist during development. Sensitive information that
may be configured in the route endpoints could potentially be included in the
dump output and is therefore not recommended being used for production usage.
This requires to have camel-xml [...]
- { "name": "camel.main.dumpRoutesDirectory", "description": "Whether to
save route dumps to files in the given directory. The name of the files are
based on original loaded resource, or an autogenerated name.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String" },
{ "name": "camel.main.dumpRoutesGeneratedIds", "description": "Whether to
include auto generated IDs in the dumped output. Default is false.",
"sourceType": "org.apache.camel.main.DefaultConfigurationProperties", "type":
"boolean", "javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.main.dumpRoutesInclude", "description": "Controls what to
include in output for route dumping. Possible values: all, routes, rests,
routeConfigurations, routeTemplates, beans. Multiple values can be separated by
comma. Default is routes.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String", "defaultValue": "routes" },
{ "name": "camel.main.dumpRoutesLog", "description": "Whether to log route
dumps to Logger", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": true },
+ { "name": "camel.main.dumpRoutesOutput", "description": "Whether to save
route dumps to an output file. If the output is a filename, then all content is
saved to this file. If the output is a directory name, then one or more files
are saved to the directory, where the names are based on the original source
file names, or auto generated names.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "string",
"javaType": "java.lang.String" },
{ "name": "camel.main.dumpRoutesResolvePlaceholders", "description":
"Whether to resolve property placeholders in the dumped output. Default is
true.", "sourceType": "org.apache.camel.main.DefaultConfigurationProperties",
"type": "boolean", "javaType": "boolean", "defaultValue": true },
{ "name": "camel.main.dumpRoutesUriAsParameters", "description": "When
dumping routes to YAML format, then this option controls whether endpoint URIs
should be expanded into a key\/value parameters.", "sourceType":
"org.apache.camel.main.DefaultConfigurationProperties", "type": "boolean",
"javaType": "boolean", "defaultValue": "false" },
{ "name": "camel.main.durationHitExitCode", "description": "Sets the exit
code for the application if duration was hit", "sourceType":
"org.apache.camel.main.MainConfigurationProperties", "type": "integer",
"javaType": "int" },
diff --git a/core/camel-main/src/main/docs/main.adoc
b/core/camel-main/src/main/docs/main.adoc
index 0614e98e98c..0020c4572ac 100644
--- a/core/camel-main/src/main/docs/main.adoc
+++ b/core/camel-main/src/main/docs/main.adoc
@@ -50,10 +50,10 @@ The camel.main supports 126 options, which are listed below.
| *camel.main.description* | Sets the description (intended for humans) of the
Camel application. | | String
| *camel.main.devConsoleEnabled* | Whether to enable developer console
(requires camel-console on classpath). The developer console is only for
assisting during development. This is NOT for production usage. | false |
boolean
| *camel.main.dumpRoutes* | If dumping is enabled then Camel will during
startup dump all loaded routes (incl rests and route templates) represented as
XML/YAML DSL into the log. This is intended for trouble shooting or to assist
during development. Sensitive information that may be configured in the route
endpoints could potentially be included in the dump output and is therefore not
recommended being used for production usage. This requires to have
camel-xml-io/camel-yaml-io on the cla [...]
-| *camel.main.dumpRoutesDirectory* | Whether to save route dumps to files in
the given directory. The name of the files are based on original loaded
resource, or an autogenerated name. | | String
| *camel.main.dumpRoutesGenerated{zwsp}Ids* | Whether to include auto
generated IDs in the dumped output. Default is false. | false | boolean
| *camel.main.dumpRoutesInclude* | Controls what to include in output for
route dumping. Possible values: all, routes, rests, routeConfigurations,
routeTemplates, beans. Multiple values can be separated by comma. Default is
routes. | routes | String
| *camel.main.dumpRoutesLog* | Whether to log route dumps to Logger | true |
boolean
+| *camel.main.dumpRoutesOutput* | Whether to save route dumps to an output
file. If the output is a filename, then all content is saved to this file. If
the output is a directory name, then one or more files are saved to the
directory, where the names are based on the original source file names, or auto
generated names. | | String
| *camel.main.dumpRoutesResolve{zwsp}Placeholders* | Whether to resolve
property placeholders in the dumped output. Default is true. | true | boolean
| *camel.main.dumpRoutesUriAs{zwsp}Parameters* | When dumping routes to YAML
format, then this option controls whether endpoint URIs should be expanded into
a key/value parameters. | false | boolean
| *camel.main.durationHitExitCode* | Sets the exit code for the application if
duration was hit | | int
diff --git
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
index 1d6346c7625..7b9ebde1703 100644
---
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
+++
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationConfigurer.java
@@ -266,7 +266,7 @@ public final class DefaultConfigurationConfigurer {
drs.setUriAsParameters(config.isDumpRoutesUriAsParameters());
drs.setGeneratedIds(config.isDumpRoutesGeneratedIds());
drs.setResolvePlaceholders(config.isDumpRoutesResolvePlaceholders());
- drs.setDirectory(config.getDumpRoutesDirectory());
+ drs.setOutput(config.getDumpRoutesOutput());
}
if (config.isContextReloadEnabled() &&
camelContext.hasService(ContextReloadStrategy.class) == null) {
ContextReloadStrategy reloader = new
DefaultContextReloadStrategy();
diff --git
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
index 6c028717251..9ef65ba9ce4 100644
---
a/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
+++
b/core/camel-main/src/main/java/org/apache/camel/main/DefaultConfigurationProperties.java
@@ -136,7 +136,7 @@ public abstract class DefaultConfigurationProperties<T> {
private boolean dumpRoutesResolvePlaceholders = true;
private boolean dumpRoutesUriAsParameters;
private boolean dumpRoutesGeneratedIds;
- private String dumpRoutesDirectory;
+ private String dumpRoutesOutput;
private Map<String, String> globalOptions;
// route controller
private boolean routeControllerSuperviseEnabled;
@@ -1451,16 +1451,19 @@ public abstract class DefaultConfigurationProperties<T>
{
this.dumpRoutesGeneratedIds = dumpRoutesGeneratedIds;
}
- public String getDumpRoutesDirectory() {
- return dumpRoutesDirectory;
+ public String getDumpRoutesOutput() {
+ return dumpRoutesOutput;
}
/**
- * Whether to save route dumps to files in the given directory. The name
of the files are based on original loaded
- * resource, or an autogenerated name.
+ * Whether to save route dumps to an output file.
+ *
+ * If the output is a filename, then all content is saved to this file. If
the output is a directory name, then one
+ * or more files are saved to the directory, where the names are based on
the original source file names, or auto
+ * generated names.
*/
- public void setDumpRoutesDirectory(String dumpRoutesDirectory) {
- this.dumpRoutesDirectory = dumpRoutesDirectory;
+ public void setDumpRoutesOutput(String dumpRoutesOutput) {
+ this.dumpRoutesOutput = dumpRoutesOutput;
}
public Map<String, String> getGlobalOptions() {
@@ -2700,11 +2703,14 @@ public abstract class DefaultConfigurationProperties<T>
{
}
/**
- * Whether to save route dumps to files in the given directory. The name
of the files are based on original loaded
- * resource, or an autogenerated name.
+ * Whether to save route dumps to an output file.
+ *
+ * If the output is a filename, then all content is saved to this file. If
the output is a directory name, then one
+ * or more files are saved to the directory, where the names are based on
the original source file names, or auto
+ * generated names.
*/
- public T withDumpRoutesDirectory(String dumpRoutesDirectory) {
- this.dumpRoutesDirectory = dumpRoutesDirectory;
+ public T withDumpRoutesOutput(String dumpRoutesOutput) {
+ this.dumpRoutesOutput = dumpRoutesOutput;
return (T) this;
}
diff --git
a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedDumpRoutesStrategyMBean.java
b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedDumpRoutesStrategyMBean.java
index 94e9aafd6c3..3057134cc29 100644
---
a/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedDumpRoutesStrategyMBean.java
+++
b/core/camel-management-api/src/main/java/org/apache/camel/api/management/mbean/ManagedDumpRoutesStrategyMBean.java
@@ -42,11 +42,11 @@ public interface ManagedDumpRoutesStrategyMBean {
@ManagedAttribute(description = "Whether to log route dumps to Logger")
void setLog(boolean log);
- @ManagedAttribute(description = "Whether to save route dumps to files in
the given directory. The name of the files are based on ids (route ids, etc.).
Existing files will be overwritten.")
- String getDirectory();
+ @ManagedAttribute(description = "Whether to save route dumps to file(s)")
+ String getOutput();
- @ManagedAttribute(description = "Whether to save route dumps to files in
the given directory. The name of the files are based on ids (route ids, etc.).
Existing files will be overwritten.")
- void setDirectory(String directory);
+ @ManagedAttribute(description = "Whether to save route dumps to file(s)")
+ void setOutput(String output);
@ManagedAttribute(description = "When dumping to YAML format, then this
option controls whether endpoint URIs should be expanded into a key/value
parameters")
boolean isUriAsParameters();
diff --git
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedDumpRouteStrategy.java
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedDumpRouteStrategy.java
index 8cf89153560..c0325ae6bb6 100644
---
a/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedDumpRouteStrategy.java
+++
b/core/camel-management/src/main/java/org/apache/camel/management/mbean/ManagedDumpRouteStrategy.java
@@ -81,13 +81,13 @@ public class ManagedDumpRouteStrategy implements
ManagedDumpRoutesStrategyMBean
}
@Override
- public String getDirectory() {
- return dumpRoutesStrategy.getDirectory();
+ public String getOutput() {
+ return dumpRoutesStrategy.getOutput();
}
@Override
- public void setDirectory(String directory) {
- dumpRoutesStrategy.setDirectory(directory);
+ public void setOutput(String output) {
+ dumpRoutesStrategy.setOutput(output);
}
@Override
diff --git
a/core/camel-management/src/test/java/org/apache/camel/management/ManagedRouteDumpStrategyTest.java
b/core/camel-management/src/test/java/org/apache/camel/management/ManagedRouteDumpStrategyTest.java
index 6ed5443f28a..0f405340a14 100644
---
a/core/camel-management/src/test/java/org/apache/camel/management/ManagedRouteDumpStrategyTest.java
+++
b/core/camel-management/src/test/java/org/apache/camel/management/ManagedRouteDumpStrategyTest.java
@@ -48,7 +48,7 @@ public class ManagedRouteDumpStrategyTest extends
ManagementTestSupport {
DefaultDumpRoutesStrategy drd = new DefaultDumpRoutesStrategy();
drd.setInclude("all");
drd.setLog(false);
- drd.setDirectory(dir);
+ drd.setOutput(dir);
drd.setResolvePlaceholders(false);
context.addService(drd);
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Transform.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Transform.java
index b00e9712147..0777b37a045 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Transform.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Transform.java
@@ -35,9 +35,8 @@ public class Transform extends CamelCommand {
List<String> files = new ArrayList<>();
@CommandLine.Option(names = {
- "--dir",
- "--directory" }, description = "Directory where the transformed
files will be saved", required = true)
- private String directory;
+ "--output" }, description = "File or directory to store
transformed files", required = true)
+ private String output;
@CommandLine.Option(names = { "--format" },
description = "Output format (xml or yaml)",
defaultValue = "yaml")
@@ -65,7 +64,7 @@ public class Transform extends CamelCommand {
main.addInitialProperty("camel.main.dumpRoutesLog", "false");
main.addInitialProperty("camel.main.dumpRoutesResolvePlaceholders", "" +
resolvePlaceholders);
main.addInitialProperty("camel.main.dumpRoutesUriAsParameters", "" +
uriAsParameters);
- main.addInitialProperty("camel.main.dumpRoutesDirectory",
directory);
+ main.addInitialProperty("camel.main.dumpRoutesOutput", output);
}
};
run.files = files;