You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/11/20 21:45:28 UTC
(camel) branch camel-3.x updated: CAMEL-19997: initial implementation of a SMB component (#12093)
This is an automated email from the ASF dual-hosted git repository.
nfilotto pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push:
new 645256a3ae2 CAMEL-19997: initial implementation of a SMB component (#12093)
645256a3ae2 is described below
commit 645256a3ae2e6be1c50f28ae39a2f80abd611208
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Mon Nov 20 22:45:16 2023 +0100
CAMEL-19997: initial implementation of a SMB component (#12093)
## Motivation
Provide an SMB component for Camel 3
## Modifications:
* backport all changes made in the main branch
* change the first version to 3.22
Co-authored-by: Otavio Rodolfo Piske <an...@gmail.com>
Co-authored-by: Claus Ibsen <cl...@gmail.com>
---
bom/camel-bom/pom.xml | 5 +
camel-dependencies/pom.xml | 1 +
catalog/camel-allcomponents/pom.xml | 5 +
.../org/apache/camel/catalog/components.properties | 1 +
.../org/apache/camel/catalog/components/smb.json | 59 ++
components/camel-smb/pom.xml | 73 ++
.../component/smb/SmbComponentConfigurer.java | 55 ++
.../camel/component/smb/SmbEndpointConfigurer.java | 187 +++++
.../camel/component/smb/SmbEndpointUriFactory.java | 104 +++
.../services/org/apache/camel/component.properties | 7 +
.../services/org/apache/camel/component/smb | 2 +
.../org/apache/camel/configurer/smb-component | 2 +
.../org/apache/camel/configurer/smb-endpoint | 2 +
.../org/apache/camel/urifactory/smb-endpoint | 2 +
.../org/apache/camel/component/smb/smb.json | 59 ++
.../camel-smb/src/main/docs/smb-component.adoc | 74 ++
.../apache/camel/component/smb/SmbComponent.java | 68 ++
.../camel/component/smb/SmbConfiguration.java | 110 +++
.../apache/camel/component/smb/SmbConsumer.java | 95 +++
.../apache/camel/component/smb/SmbEndpoint.java | 108 +++
.../org/apache/camel/component/smb/SmbIOBean.java | 65 ++
.../apache/camel/component/smb/SmbReadBean.java | 55 ++
.../apache/camel/component/smb/SmbComponentIT.java | 68 ++
.../camel-smb/src/test/resources/log4j2.properties | 35 +
components/pom.xml | 1 +
.../org/apache/camel/main/components.properties | 1 +
.../components/modules/ROOT/examples/json/smb.json | 1 +
docs/components/modules/ROOT/nav.adoc | 1 +
.../modules/ROOT/pages/smb-component.adoc | 1 +
.../component/ComponentsBuilderFactory.java | 13 +
.../component/dsl/SmbComponentBuilderFactory.java | 116 +++
.../src/generated/resources/metadata.json | 22 +
.../builder/endpoint/EndpointBuilderFactory.java | 1 +
.../camel/builder/endpoint/EndpointBuilders.java | 1 +
.../builder/endpoint/StaticEndpointBuilders.java | 57 ++
.../endpoint/dsl/SmbEndpointBuilderFactory.java | 919 +++++++++++++++++++++
.../camel-component-known-dependencies.properties | 1 +
parent/pom.xml | 6 +
test-infra/camel-test-infra-smb/pom.xml | 55 ++
.../src/main/resources/META-INF/MANIFEST.MF | 0
.../camel/test/infra/smb/common/SmbProperties.java | 28 +
.../test/infra/smb/services/SmbContainer.java | 54 ++
.../smb/services/SmbLocalContainerService.java | 67 ++
.../test/infra/smb/services/SmbRemoteService.java | 57 ++
.../camel/test/infra/smb/services/SmbService.java | 55 ++
.../test/infra/smb/services/SmbServiceFactory.java | 34 +
.../camel/test/infra/smb/services/Dockerfile | 26 +
.../apache/camel/test/infra/smb/services/smb.conf | 59 ++
.../apache/camel/test/infra/smb/services/start.sh | 39 +
test-infra/pom.xml | 1 +
50 files changed, 2858 insertions(+)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 75aed4cefd3..72b11ab71f5 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1811,6 +1811,11 @@
<artifactId>camel-slack</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-smb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-smpp</artifactId>
diff --git a/camel-dependencies/pom.xml b/camel-dependencies/pom.xml
index 565f973f79b..c253a6c97d2 100644
--- a/camel-dependencies/pom.xml
+++ b/camel-dependencies/pom.xml
@@ -507,6 +507,7 @@
<smallrye-fault-tolerance-version>5.6.0</smallrye-fault-tolerance-version>
<smallrye-health-version>3.3.0</smallrye-health-version>
<smallrye-metrics-version>3.0.5</smallrye-metrics-version>
+ <smbj-version>0.12.0</smbj-version>
<snakeyaml-engine-version>2.3</snakeyaml-engine-version>
<snakeyaml-version>1.33</snakeyaml-version>
<snappy-java-version>1.1.10.3</snappy-java-version>
diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml
index f32a8fe0928..84853e90d5f 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1593,6 +1593,11 @@
<artifactId>camel-slack</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-smb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-smpp</artifactId>
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
index 242856e2180..41c6a3ea79a 100644
--- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties
@@ -285,6 +285,7 @@ sftp
sjms
sjms2
slack
+smb
smpp
smpps
smtp
diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smb.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smb.json
new file mode 100644
index 00000000000..eb9dc26030d
--- /dev/null
+++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/smb.json
@@ -0,0 +1,59 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "smb",
+ "title": "SMB",
+ "description": "Receive files from SMB (Server Message Block) shares.",
+ "deprecated": false,
+ "firstVersion": "3.22.0",
+ "label": "file",
+ "javaType": "org.apache.camel.component.smb.SmbComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-smb",
+ "version": "3.22.0-SNAPSHOT",
+ "scheme": "smb",
+ "extendsScheme": "",
+ "syntax": "smb:hostname:port\/shareName",
+ "async": false,
+ "api": false,
+ "consumerOnly": true,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
+ "componentProperties": {
+ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+ "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+ },
+ "properties": {
+ "hostname": { "kind": "path", "displayName": "Hostname", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The share hostname or IP address" },
+ "port": { "kind": "path", "displayName": "Port", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 445, "description": "The share port number" },
+ "shareName": { "kind": "path", "displayName": "Share Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The name of the share to connect to." },
+ "idempotentRepository": { "kind": "parameter", "displayName": "Idempotent Repository", "group": "consumer", "label": "advanced,consumer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which [...]
+ "path": { "kind": "parameter", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The path, within the share, to consume the files from" },
+ "searchPattern": { "kind": "parameter", "displayName": "Search Pattern", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "*.txt", "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The search pattern used to list the files" },
+ "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
+ "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
+ "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation [...]
+ "smbIoBean": { "kind": "parameter", "displayName": "Smb Io Bean", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.smb.SmbIOBean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "An optional SMB I\/O bean to use to setup the file access attributes when reading\/writing a file" },
+ "backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." },
+ "backoffIdleThreshold": { "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." },
+ "backoffMultiplier": { "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening agai [...]
+ "delay": { "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." },
+ "greedy": { "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." },
+ "initialDelay": { "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." },
+ "repeatCount": { "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." },
+ "runLoggingLevel": { "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level [...]
+ "scheduledExecutorService": { "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." },
+ "scheduler": { "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" },
+ "schedulerProperties": { "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." },
+ "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." },
+ "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
+ "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
+ "domain": { "kind": "parameter", "displayName": "Domain", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The user domain" },
+ "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The password to access the share" },
+ "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The username required to access the share" }
+ }
+}
diff --git a/components/camel-smb/pom.xml b/components/camel-smb/pom.xml
new file mode 100644
index 00000000000..31197c46be3
--- /dev/null
+++ b/components/camel-smb/pom.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>components</artifactId>
+ <version>3.22.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-smb</artifactId>
+ <packaging>jar</packaging>
+
+ <name>Camel :: SMB</name>
+ <description>Server Message Block (SMB) file shares</description>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-support</artifactId>
+ </dependency>
+
+ <!-- CIFS -->
+ <dependency>
+ <groupId>com.hierynomus</groupId>
+ <artifactId>smbj</artifactId>
+ <version>${smbj-version}</version>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <!-- testing -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-smb</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbComponentConfigurer.java b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbComponentConfigurer.java
new file mode 100644
index 00000000000..29ce7626b58
--- /dev/null
+++ b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbComponentConfigurer.java
@@ -0,0 +1,55 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.smb;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SmbComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ SmbComponent target = (SmbComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled": return boolean.class;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ SmbComponent target = (SmbComponent) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "autowiredenabled":
+ case "autowiredEnabled": return target.isAutowiredEnabled();
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointConfigurer.java b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointConfigurer.java
new file mode 100644
index 00000000000..5dee425eea5
--- /dev/null
+++ b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointConfigurer.java
@@ -0,0 +1,187 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.smb;
+
+import java.util.Map;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurerGetter;
+import org.apache.camel.spi.ConfigurerStrategy;
+import org.apache.camel.spi.GeneratedPropertyConfigurer;
+import org.apache.camel.util.CaseInsensitiveMap;
+import org.apache.camel.support.component.PropertyConfigurerSupport;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@SuppressWarnings("unchecked")
+public class SmbEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
+
+ @Override
+ public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
+ SmbEndpoint target = (SmbEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "backofferrorthreshold":
+ case "backoffErrorThreshold": target.setBackoffErrorThreshold(property(camelContext, int.class, value)); return true;
+ case "backoffidlethreshold":
+ case "backoffIdleThreshold": target.setBackoffIdleThreshold(property(camelContext, int.class, value)); return true;
+ case "backoffmultiplier":
+ case "backoffMultiplier": target.setBackoffMultiplier(property(camelContext, int.class, value)); return true;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
+ case "delay": target.setDelay(property(camelContext, long.class, value)); return true;
+ case "domain": target.getConfiguration().setDomain(property(camelContext, java.lang.String.class, value)); return true;
+ case "exceptionhandler":
+ case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
+ case "exchangepattern":
+ case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
+ case "greedy": target.setGreedy(property(camelContext, boolean.class, value)); return true;
+ case "idempotentrepository":
+ case "idempotentRepository": target.getConfiguration().setIdempotentRepository(property(camelContext, org.apache.camel.spi.IdempotentRepository.class, value)); return true;
+ case "initialdelay":
+ case "initialDelay": target.setInitialDelay(property(camelContext, long.class, value)); return true;
+ case "password": target.getConfiguration().setPassword(property(camelContext, java.lang.String.class, value)); return true;
+ case "path": target.getConfiguration().setPath(property(camelContext, java.lang.String.class, value)); return true;
+ case "pollstrategy":
+ case "pollStrategy": target.setPollStrategy(property(camelContext, org.apache.camel.spi.PollingConsumerPollStrategy.class, value)); return true;
+ case "repeatcount":
+ case "repeatCount": target.setRepeatCount(property(camelContext, long.class, value)); return true;
+ case "runlogginglevel":
+ case "runLoggingLevel": target.setRunLoggingLevel(property(camelContext, org.apache.camel.LoggingLevel.class, value)); return true;
+ case "scheduledexecutorservice":
+ case "scheduledExecutorService": target.setScheduledExecutorService(property(camelContext, java.util.concurrent.ScheduledExecutorService.class, value)); return true;
+ case "scheduler": target.setScheduler(property(camelContext, java.lang.Object.class, value)); return true;
+ case "schedulerproperties":
+ case "schedulerProperties": target.setSchedulerProperties(property(camelContext, java.util.Map.class, value)); return true;
+ case "searchpattern":
+ case "searchPattern": target.getConfiguration().setSearchPattern(property(camelContext, java.lang.String.class, value)); return true;
+ case "sendemptymessagewhenidle":
+ case "sendEmptyMessageWhenIdle": target.setSendEmptyMessageWhenIdle(property(camelContext, boolean.class, value)); return true;
+ case "smbiobean":
+ case "smbIoBean": target.getConfiguration().setSmbIoBean(property(camelContext, org.apache.camel.component.smb.SmbIOBean.class, value)); return true;
+ case "startscheduler":
+ case "startScheduler": target.setStartScheduler(property(camelContext, boolean.class, value)); return true;
+ case "timeunit":
+ case "timeUnit": target.setTimeUnit(property(camelContext, java.util.concurrent.TimeUnit.class, value)); return true;
+ case "usefixeddelay":
+ case "useFixedDelay": target.setUseFixedDelay(property(camelContext, boolean.class, value)); return true;
+ case "username": target.getConfiguration().setUsername(property(camelContext, java.lang.String.class, value)); return true;
+ default: return false;
+ }
+ }
+
+ @Override
+ public Class<?> getOptionType(String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "backofferrorthreshold":
+ case "backoffErrorThreshold": return int.class;
+ case "backoffidlethreshold":
+ case "backoffIdleThreshold": return int.class;
+ case "backoffmultiplier":
+ case "backoffMultiplier": return int.class;
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return boolean.class;
+ case "delay": return long.class;
+ case "domain": return java.lang.String.class;
+ case "exceptionhandler":
+ case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
+ case "exchangepattern":
+ case "exchangePattern": return org.apache.camel.ExchangePattern.class;
+ case "greedy": return boolean.class;
+ case "idempotentrepository":
+ case "idempotentRepository": return org.apache.camel.spi.IdempotentRepository.class;
+ case "initialdelay":
+ case "initialDelay": return long.class;
+ case "password": return java.lang.String.class;
+ case "path": return java.lang.String.class;
+ case "pollstrategy":
+ case "pollStrategy": return org.apache.camel.spi.PollingConsumerPollStrategy.class;
+ case "repeatcount":
+ case "repeatCount": return long.class;
+ case "runlogginglevel":
+ case "runLoggingLevel": return org.apache.camel.LoggingLevel.class;
+ case "scheduledexecutorservice":
+ case "scheduledExecutorService": return java.util.concurrent.ScheduledExecutorService.class;
+ case "scheduler": return java.lang.Object.class;
+ case "schedulerproperties":
+ case "schedulerProperties": return java.util.Map.class;
+ case "searchpattern":
+ case "searchPattern": return java.lang.String.class;
+ case "sendemptymessagewhenidle":
+ case "sendEmptyMessageWhenIdle": return boolean.class;
+ case "smbiobean":
+ case "smbIoBean": return org.apache.camel.component.smb.SmbIOBean.class;
+ case "startscheduler":
+ case "startScheduler": return boolean.class;
+ case "timeunit":
+ case "timeUnit": return java.util.concurrent.TimeUnit.class;
+ case "usefixeddelay":
+ case "useFixedDelay": return boolean.class;
+ case "username": return java.lang.String.class;
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
+ SmbEndpoint target = (SmbEndpoint) obj;
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "backofferrorthreshold":
+ case "backoffErrorThreshold": return target.getBackoffErrorThreshold();
+ case "backoffidlethreshold":
+ case "backoffIdleThreshold": return target.getBackoffIdleThreshold();
+ case "backoffmultiplier":
+ case "backoffMultiplier": return target.getBackoffMultiplier();
+ case "bridgeerrorhandler":
+ case "bridgeErrorHandler": return target.isBridgeErrorHandler();
+ case "delay": return target.getDelay();
+ case "domain": return target.getConfiguration().getDomain();
+ case "exceptionhandler":
+ case "exceptionHandler": return target.getExceptionHandler();
+ case "exchangepattern":
+ case "exchangePattern": return target.getExchangePattern();
+ case "greedy": return target.isGreedy();
+ case "idempotentrepository":
+ case "idempotentRepository": return target.getConfiguration().getIdempotentRepository();
+ case "initialdelay":
+ case "initialDelay": return target.getInitialDelay();
+ case "password": return target.getConfiguration().getPassword();
+ case "path": return target.getConfiguration().getPath();
+ case "pollstrategy":
+ case "pollStrategy": return target.getPollStrategy();
+ case "repeatcount":
+ case "repeatCount": return target.getRepeatCount();
+ case "runlogginglevel":
+ case "runLoggingLevel": return target.getRunLoggingLevel();
+ case "scheduledexecutorservice":
+ case "scheduledExecutorService": return target.getScheduledExecutorService();
+ case "scheduler": return target.getScheduler();
+ case "schedulerproperties":
+ case "schedulerProperties": return target.getSchedulerProperties();
+ case "searchpattern":
+ case "searchPattern": return target.getConfiguration().getSearchPattern();
+ case "sendemptymessagewhenidle":
+ case "sendEmptyMessageWhenIdle": return target.isSendEmptyMessageWhenIdle();
+ case "smbiobean":
+ case "smbIoBean": return target.getConfiguration().getSmbIoBean();
+ case "startscheduler":
+ case "startScheduler": return target.isStartScheduler();
+ case "timeunit":
+ case "timeUnit": return target.getTimeUnit();
+ case "usefixeddelay":
+ case "useFixedDelay": return target.isUseFixedDelay();
+ case "username": return target.getConfiguration().getUsername();
+ default: return null;
+ }
+ }
+
+ @Override
+ public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
+ switch (ignoreCase ? name.toLowerCase() : name) {
+ case "schedulerproperties":
+ case "schedulerProperties": return java.lang.Object.class;
+ default: return null;
+ }
+ }
+}
+
diff --git a/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointUriFactory.java b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointUriFactory.java
new file mode 100644
index 00000000000..09413729f60
--- /dev/null
+++ b/components/camel-smb/src/generated/java/org/apache/camel/component/smb/SmbEndpointUriFactory.java
@@ -0,0 +1,104 @@
+/* Generated by camel build tools - do NOT edit this file! */
+package org.apache.camel.component.smb;
+
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.spi.EndpointUriFactory;
+
+/**
+ * Generated by camel build tools - do NOT edit this file!
+ */
+public class SmbEndpointUriFactory extends org.apache.camel.support.component.EndpointUriFactorySupport implements EndpointUriFactory {
+
+ private static final String BASE = ":hostname:port/shareName";
+
+ private static final Set<String> PROPERTY_NAMES;
+ private static final Set<String> SECRET_PROPERTY_NAMES;
+ private static final Set<String> MULTI_VALUE_PREFIXES;
+ static {
+ Set<String> props = new HashSet<>(29);
+ props.add("backoffErrorThreshold");
+ props.add("backoffIdleThreshold");
+ props.add("backoffMultiplier");
+ props.add("bridgeErrorHandler");
+ props.add("delay");
+ props.add("domain");
+ props.add("exceptionHandler");
+ props.add("exchangePattern");
+ props.add("greedy");
+ props.add("hostname");
+ props.add("idempotentRepository");
+ props.add("initialDelay");
+ props.add("password");
+ props.add("path");
+ props.add("pollStrategy");
+ props.add("port");
+ props.add("repeatCount");
+ props.add("runLoggingLevel");
+ props.add("scheduledExecutorService");
+ props.add("scheduler");
+ props.add("schedulerProperties");
+ props.add("searchPattern");
+ props.add("sendEmptyMessageWhenIdle");
+ props.add("shareName");
+ props.add("smbIoBean");
+ props.add("startScheduler");
+ props.add("timeUnit");
+ props.add("useFixedDelay");
+ props.add("username");
+ PROPERTY_NAMES = Collections.unmodifiableSet(props);
+ Set<String> secretProps = new HashSet<>(3);
+ secretProps.add("password");
+ secretProps.add("shareName");
+ secretProps.add("username");
+ SECRET_PROPERTY_NAMES = Collections.unmodifiableSet(secretProps);
+ Set<String> prefixes = new HashSet<>(1);
+ prefixes.add("scheduler.");
+ MULTI_VALUE_PREFIXES = Collections.unmodifiableSet(prefixes);
+ }
+
+ @Override
+ public boolean isEnabled(String scheme) {
+ return "smb".equals(scheme);
+ }
+
+ @Override
+ public String buildUri(String scheme, Map<String, Object> properties, boolean encode) throws URISyntaxException {
+ String syntax = scheme + BASE;
+ String uri = syntax;
+
+ Map<String, Object> copy = new HashMap<>(properties);
+
+ uri = buildPathParameter(syntax, uri, "hostname", null, true, copy);
+ uri = buildPathParameter(syntax, uri, "port", 445, false, copy);
+ uri = buildPathParameter(syntax, uri, "shareName", null, false, copy);
+ uri = buildQueryParameters(uri, copy, encode);
+ return uri;
+ }
+
+ @Override
+ public Set<String> propertyNames() {
+ return PROPERTY_NAMES;
+ }
+
+ @Override
+ public Set<String> secretPropertyNames() {
+ return SECRET_PROPERTY_NAMES;
+ }
+
+ @Override
+ public Set<String> multiValuePrefixes() {
+ return MULTI_VALUE_PREFIXES;
+ }
+
+ @Override
+ public boolean isLenientProperties() {
+ return false;
+ }
+}
+
diff --git a/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component.properties b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component.properties
new file mode 100644
index 00000000000..c1626b2631a
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component.properties
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!
+components=smb
+groupId=org.apache.camel
+artifactId=camel-smb
+version=3.22.0-SNAPSHOT
+projectName=Camel :: SMB
+projectDescription=Server Message Block (SMB) file shares
diff --git a/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component/smb b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component/smb
new file mode 100644
index 00000000000..ba665193f3d
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/component/smb
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.smb.SmbComponent
diff --git a/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-component b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-component
new file mode 100644
index 00000000000..c520762dd29
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-component
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.smb.SmbComponentConfigurer
diff --git a/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-endpoint b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-endpoint
new file mode 100644
index 00000000000..bb1271301bc
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/configurer/smb-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.smb.SmbEndpointConfigurer
diff --git a/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/urifactory/smb-endpoint b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/urifactory/smb-endpoint
new file mode 100644
index 00000000000..d4661df9d67
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/META-INF/services/org/apache/camel/urifactory/smb-endpoint
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.smb.SmbEndpointUriFactory
diff --git a/components/camel-smb/src/generated/resources/org/apache/camel/component/smb/smb.json b/components/camel-smb/src/generated/resources/org/apache/camel/component/smb/smb.json
new file mode 100644
index 00000000000..eb9dc26030d
--- /dev/null
+++ b/components/camel-smb/src/generated/resources/org/apache/camel/component/smb/smb.json
@@ -0,0 +1,59 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "smb",
+ "title": "SMB",
+ "description": "Receive files from SMB (Server Message Block) shares.",
+ "deprecated": false,
+ "firstVersion": "3.22.0",
+ "label": "file",
+ "javaType": "org.apache.camel.component.smb.SmbComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-smb",
+ "version": "3.22.0-SNAPSHOT",
+ "scheme": "smb",
+ "extendsScheme": "",
+ "syntax": "smb:hostname:port\/shareName",
+ "async": false,
+ "api": false,
+ "consumerOnly": true,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
+ "componentProperties": {
+ "bridgeErrorHandler": { "kind": "property", "displayName": "Bridge Error Handler", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now be processed as a me [...]
+ "autowiredEnabled": { "kind": "property", "displayName": "Autowired Enabled", "group": "advanced", "label": "advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether autowiring is enabled. This is used for automatic autowiring options (the option must be marked as autowired) by looking up in the registry to find if there is a single instance of matching type, which t [...]
+ },
+ "properties": {
+ "hostname": { "kind": "path", "displayName": "Hostname", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The share hostname or IP address" },
+ "port": { "kind": "path", "displayName": "Port", "group": "consumer", "label": "", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 445, "description": "The share port number" },
+ "shareName": { "kind": "path", "displayName": "Share Name", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "description": "The name of the share to connect to." },
+ "idempotentRepository": { "kind": "parameter", "displayName": "Idempotent Repository", "group": "consumer", "label": "advanced,consumer", "required": false, "type": "object", "javaType": "org.apache.camel.spi.IdempotentRepository", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "A pluggable repository org.apache.camel.spi.IdempotentRepository which [...]
+ "path": { "kind": "parameter", "displayName": "Path", "group": "consumer", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The path, within the share, to consume the files from" },
+ "searchPattern": { "kind": "parameter", "displayName": "Search Pattern", "group": "consumer", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "*.txt", "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The search pattern used to list the files" },
+ "sendEmptyMessageWhenIdle": { "kind": "parameter", "displayName": "Send Empty Message When Idle", "group": "consumer", "label": "consumer", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead." },
+ "bridgeErrorHandler": { "kind": "parameter", "displayName": "Bridge Error Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "Allows for bridging the consumer to the Camel routing Error Handler, which mean any exceptions occurred while the consumer is trying to pickup incoming messages, or the likes, will now [...]
+ "exceptionHandler": { "kind": "parameter", "displayName": "Exception Handler", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.ExceptionHandler", "optionalPrefix": "consumer.", "deprecated": false, "autowired": false, "secret": false, "description": "To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this option is not in use. By default the con [...]
+ "exchangePattern": { "kind": "parameter", "displayName": "Exchange Pattern", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.ExchangePattern", "enum": [ "InOnly", "InOut", "InOptionalOut" ], "deprecated": false, "autowired": false, "secret": false, "description": "Sets the exchange pattern when the consumer creates an exchange." },
+ "pollStrategy": { "kind": "parameter", "displayName": "Poll Strategy", "group": "consumer (advanced)", "label": "consumer,advanced", "required": false, "type": "object", "javaType": "org.apache.camel.spi.PollingConsumerPollStrategy", "deprecated": false, "autowired": false, "secret": false, "description": "A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation [...]
+ "smbIoBean": { "kind": "parameter", "displayName": "Smb Io Bean", "group": "advanced", "label": "advanced", "required": false, "type": "object", "javaType": "org.apache.camel.component.smb.SmbIOBean", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "An optional SMB I\/O bean to use to setup the file access attributes when reading\/writing a file" },
+ "backoffErrorThreshold": { "kind": "parameter", "displayName": "Backoff Error Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent error polls (failed due some error) that should happen before the backoffMultipler should kick-in." },
+ "backoffIdleThreshold": { "kind": "parameter", "displayName": "Backoff Idle Threshold", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "The number of subsequent idle polls that should happen before the backoffMultipler should kick-in." },
+ "backoffMultiplier": { "kind": "parameter", "displayName": "Backoff Multiplier", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "int", "deprecated": false, "autowired": false, "secret": false, "description": "To let the scheduled polling consumer backoff if there has been a number of subsequent idles\/errors in a row. The multiplier is then the number of polls that will be skipped before the next actual attempt is happening agai [...]
+ "delay": { "kind": "parameter", "displayName": "Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 500, "description": "Milliseconds before the next poll." },
+ "greedy": { "kind": "parameter", "displayName": "Greedy", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": false, "description": "If greedy is enabled, then the ScheduledPollConsumer will run immediately again, if the previous run polled 1 or more messages." },
+ "initialDelay": { "kind": "parameter", "displayName": "Initial Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 1000, "description": "Milliseconds before the first poll starts." },
+ "repeatCount": { "kind": "parameter", "displayName": "Repeat Count", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "integer", "javaType": "long", "deprecated": false, "autowired": false, "secret": false, "defaultValue": 0, "description": "Specifies a maximum limit of number of fires. So if you set it to 1, the scheduler will only fire once. If you set it to 5, it will only fire five times. A value of zero or negative means fire forever." },
+ "runLoggingLevel": { "kind": "parameter", "displayName": "Run Logging Level", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "org.apache.camel.LoggingLevel", "enum": [ "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "OFF" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "TRACE", "description": "The consumer logs a start\/complete log line when it polls. This option allows you to configure the logging level [...]
+ "scheduledExecutorService": { "kind": "parameter", "displayName": "Scheduled Executor Service", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.ScheduledExecutorService", "deprecated": false, "autowired": false, "secret": false, "description": "Allows for configuring a custom\/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool." },
+ "scheduler": { "kind": "parameter", "displayName": "Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.lang.Object", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "none", "description": "To use a cron scheduler from either camel-spring or camel-quartz component. Use value spring or quartz for built in scheduler" },
+ "schedulerProperties": { "kind": "parameter", "displayName": "Scheduler Properties", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.Map<java.lang.String, java.lang.Object>", "prefix": "scheduler.", "multiValue": true, "deprecated": false, "autowired": false, "secret": false, "description": "To configure additional properties when using a custom scheduler or any of the Quartz, Spring based scheduler." },
+ "startScheduler": { "kind": "parameter", "displayName": "Start Scheduler", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Whether the scheduler should be auto started." },
+ "timeUnit": { "kind": "parameter", "displayName": "Time Unit", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "object", "javaType": "java.util.concurrent.TimeUnit", "enum": [ "NANOSECONDS", "MICROSECONDS", "MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MILLISECONDS", "description": "Time unit for initialDelay and delay options." },
+ "useFixedDelay": { "kind": "parameter", "displayName": "Use Fixed Delay", "group": "scheduler", "label": "consumer,scheduler", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "description": "Controls if fixed delay or fixed rate is used. See ScheduledExecutorService in JDK for details." },
+ "domain": { "kind": "parameter", "displayName": "Domain", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The user domain" },
+ "password": { "kind": "parameter", "displayName": "Password", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The password to access the share" },
+ "username": { "kind": "parameter", "displayName": "Username", "group": "security", "label": "security", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": true, "configurationClass": "org.apache.camel.component.smb.SmbConfiguration", "configurationField": "configuration", "description": "The username required to access the share" }
+ }
+}
diff --git a/components/camel-smb/src/main/docs/smb-component.adoc b/components/camel-smb/src/main/docs/smb-component.adoc
new file mode 100644
index 00000000000..2f238ce6e6d
--- /dev/null
+++ b/components/camel-smb/src/main/docs/smb-component.adoc
@@ -0,0 +1,74 @@
+= SMB Component
+:doctitle: SMB
+:shortname: smb
+:artifactid: camel-smb
+:description: Receive files from SMB (Server Message Block) shares.
+:since: 3.22
+:supportlevel: Preview
+:component-header: Only consumer is supported
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The Server Message Block (SMB) component provides a way to connect natively to SMB file shares, such as those provided by Microsoft Windows or https://www.samba.org/[Samba].
+
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-smb</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+== URI format
+
+----
+smb:address[:port]/shareName[?options]
+----
+
+// component-configure options: START
+
+// component-configure options: END
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+// component options: END
+
+// endpoint options: START
+
+// endpoint options: END
+
+// component headers: START
+include::partial$component-endpoint-headers.adoc[]
+// component headers: END
+
+
+== Examples
+
+For instance, polling all the files from an SMB file share and reading their contents would look like this:
+
+[source,java]
+----
+private void process(Exchange exchange) throws IOException {
+ final File file = exchange.getMessage().getBody(File.class);
+ try (InputStream inputStream = file.getInputStream()) {
+ LOG.debug("Read exchange: {}, with contents: {}", file.getFileInformation(), new String(inputStream.readAllBytes()));
+ }
+}
+
+public void configure() {
+ fromF("smb:%s/%s?username=%s&password=%s&path=/", service.address(), service.shareName(), service.userName(), service.password())
+ .process(this::process)
+ .to("mock:result");
+}
+----
+
+[NOTE]
+====
+Beware that the File object provided is not a `java.io.File` instance, but, instead a `com.hierynomus.smbj.share.File` instance.
+====
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbComponent.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbComponent.java
new file mode 100644
index 00000000000..411ae2b208f
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbComponent.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smb;
+
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.util.ObjectHelper;
+import org.apache.camel.util.StringHelper;
+
+@Component("smb")
+public class SmbComponent extends DefaultComponent {
+
+ protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
+ if (ObjectHelper.isEmpty(remaining)) {
+ throw new IllegalArgumentException("Host IP or address must be configured on endpoint using syntax smb:host:port");
+ }
+
+ final SmbEndpoint endpoint = new SmbEndpoint(uri, this);
+
+ final String hostPart = StringHelper.before(remaining, "/");
+ if (hostPart != null && hostPart.contains(":")) {
+ parseHost(hostPart, endpoint);
+ } else {
+ endpoint.setHostname(hostPart);
+ }
+
+ String path = StringHelper.after(remaining, "/");
+
+ setProperties(endpoint, parameters);
+ endpoint.setShareName(path);
+
+ return endpoint;
+ }
+
+ private static void parseHost(String hostPart, SmbEndpoint endpoint) {
+ // Host part is in the format hostname:port or ip:port
+ String host = StringHelper.before(hostPart, ":");
+ if (ObjectHelper.isEmpty(host)) {
+ throw new IllegalArgumentException("Invalid host or address: " + hostPart);
+ }
+
+ endpoint.setHostname(host);
+
+ String port = StringHelper.after(hostPart, ":");
+ if (ObjectHelper.isEmpty(port)) {
+ throw new IllegalArgumentException("Invalid port given on host: " + hostPart);
+ }
+
+ endpoint.setPort(Integer.parseInt(port));
+ }
+}
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConfiguration.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConfiguration.java
new file mode 100644
index 00000000000..6247cf10772
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConfiguration.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smb;
+
+import org.apache.camel.spi.IdempotentRepository;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
+import org.apache.camel.support.processor.idempotent.MemoryIdempotentRepository;
+
+@UriParams
+public class SmbConfiguration {
+
+ protected static final int DEFAULT_IDEMPOTENT_CACHE_SIZE = 1000;
+
+ @UriParam(label = "security", description = "The username required to access the share", secret = true)
+ private String username;
+
+ @UriParam(label = "security", description = "The password to access the share", secret = true)
+ private String password;
+
+ @UriParam(label = "security", description = "The user domain")
+ private String domain;
+
+ @Metadata(required = true)
+ @UriParam(description = "The path, within the share, to consume the files from")
+ private String path;
+
+ @UriParam(defaultValue = "*.txt", description = "The search pattern used to list the files")
+ private String searchPattern;
+
+ @UriParam(label = "advanced",
+ description = "An optional SMB I/O bean to use to setup the file access attributes when reading/writing a file")
+ private SmbIOBean smbIoBean = new SmbReadBean();
+
+ @UriParam(label = "advanced,consumer", description = "A pluggable repository org.apache.camel.spi.IdempotentRepository "
+ + "which by default use MemoryIdempotentRepository if none is specified.")
+ protected IdempotentRepository idempotentRepository
+ = MemoryIdempotentRepository.memoryIdempotentRepository(DEFAULT_IDEMPOTENT_CACHE_SIZE);
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public String getDomain() {
+ return domain;
+ }
+
+ public void setDomain(String domain) {
+ this.domain = domain;
+ }
+
+ public SmbIOBean getSmbIoBean() {
+ return smbIoBean;
+ }
+
+ public void setSmbIoBean(SmbIOBean smbIoBean) {
+ this.smbIoBean = smbIoBean;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public String getSearchPattern() {
+ return searchPattern;
+ }
+
+ public void setSearchPattern(String searchPattern) {
+ this.searchPattern = searchPattern;
+ }
+
+ public IdempotentRepository getIdempotentRepository() {
+ return idempotentRepository;
+ }
+
+ public void setIdempotentRepository(IdempotentRepository idempotentRepository) {
+ this.idempotentRepository = idempotentRepository;
+ }
+}
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConsumer.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConsumer.java
new file mode 100644
index 00000000000..d9bb35aba00
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbConsumer.java
@@ -0,0 +1,95 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smb;
+
+import com.hierynomus.msfscc.fileinformation.FileIdBothDirectoryInformation;
+import com.hierynomus.smbj.SMBClient;
+import com.hierynomus.smbj.auth.AuthenticationContext;
+import com.hierynomus.smbj.connection.Connection;
+import com.hierynomus.smbj.session.Session;
+import com.hierynomus.smbj.share.DiskShare;
+import com.hierynomus.smbj.share.File;
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.spi.IdempotentRepository;
+import org.apache.camel.support.ScheduledPollConsumer;
+
+public class SmbConsumer extends ScheduledPollConsumer {
+ private final SmbEndpoint endpoint;
+ private final SmbConfiguration configuration;
+
+ private final SMBClient smbClient = new SMBClient();
+
+ public SmbConsumer(SmbEndpoint endpoint, Processor processor) {
+ super(endpoint, processor);
+ this.endpoint = endpoint;
+ this.configuration = endpoint.getConfiguration();
+ }
+
+ @Override
+ protected int poll() throws Exception {
+ int polledCount = 0;
+
+ // start a single threaded pool to monitor events
+ try (Connection connection = smbClient.connect(endpoint.getHostname(), endpoint.getPort())) {
+ AuthenticationContext ac = new AuthenticationContext(
+ configuration.getUsername(), configuration.getPassword().toCharArray(),
+ configuration.getDomain());
+ Session session = connection.authenticate(ac);
+
+ // Connect to Share
+ try (DiskShare share = (DiskShare) session.connectShare(endpoint.getShareName())) {
+ SmbIOBean smbIOBean = configuration.getSmbIoBean();
+
+ IdempotentRepository repository = configuration.getIdempotentRepository();
+
+ for (FileIdBothDirectoryInformation f : share.list(configuration.getPath(), configuration.getSearchPattern())) {
+ if (f.getFileName().equals(".") || f.getFileName().equals("..")) {
+ continue;
+ }
+
+ if (!repository.contains(f.getFileName())) {
+ polledCount++;
+ final Exchange exchange = createExchange(true);
+
+ final File file = share.openFile(f.getFileName(),
+ smbIOBean.accessMask(),
+ smbIOBean.attributes(),
+ smbIOBean.shareAccesses(),
+ smbIOBean.createDisposition(),
+ smbIOBean.createOptions());
+
+ repository.add(f.getFileName());
+ exchange.getMessage().setBody(file);
+ try {
+ getProcessor().process(exchange);
+ } catch (Exception e) {
+ exchange.setException(e);
+ }
+ if (exchange.getException() != null) {
+ Exception e = exchange.getException();
+ String msg = "Error processing file " + f.getFileName() + " due to " + e.getMessage();
+ handleException(msg, exchange, e);
+ }
+ }
+ }
+ }
+ }
+
+ return polledCount;
+ }
+}
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbEndpoint.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbEndpoint.java
new file mode 100644
index 00000000000..bbcc55e29c1
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbEndpoint.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smb;
+
+import org.apache.camel.Category;
+import org.apache.camel.Consumer;
+import org.apache.camel.Processor;
+import org.apache.camel.Producer;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.support.ScheduledPollEndpoint;
+
+/**
+ * Receive files from SMB (Server Message Block) shares.
+ */
+@UriEndpoint(firstVersion = "3.22.0", scheme = "smb", title = "SMB", syntax = "smb:hostname:port/shareName",
+ consumerOnly = true,
+ category = { Category.FILE })
+public class SmbEndpoint extends ScheduledPollEndpoint {
+
+ @UriPath
+ @Metadata(required = true)
+ private String hostname;
+ @UriPath(defaultValue = "445")
+ private int port;
+ @UriPath(secret = true)
+ private String shareName;
+
+ @UriParam
+ private SmbConfiguration configuration = new SmbConfiguration();
+
+ public SmbEndpoint() {
+ }
+
+ public SmbEndpoint(String uri, SmbComponent component) {
+ super(uri, component);
+ }
+
+ @Override
+ public Producer createProducer() {
+ throw new UnsupportedOperationException("SMB producer is not supported.");
+ }
+
+ @Override
+ public Consumer createConsumer(Processor processor) throws Exception {
+ Consumer consumer = new SmbConsumer(this, processor);
+ configureConsumer(consumer);
+ return consumer;
+ }
+
+ public SmbConfiguration getConfiguration() {
+ return configuration;
+ }
+
+ public void setConfiguration(SmbConfiguration configuration) {
+ this.configuration = configuration;
+ }
+
+ public String getHostname() {
+ return hostname;
+ }
+
+ /**
+ * The share hostname or IP address
+ */
+ public void setHostname(String hostname) {
+ this.hostname = hostname;
+ }
+
+ public int getPort() {
+ return port;
+ }
+
+ /**
+ * The share port number
+ */
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public String getShareName() {
+ return shareName;
+ }
+
+ /**
+ * The name of the share to connect to.
+ */
+ public void setShareName(String shareName) {
+ this.shareName = shareName;
+ }
+
+}
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbIOBean.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbIOBean.java
new file mode 100644
index 00000000000..1205ef8bbd2
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbIOBean.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.smb;
+
+import java.util.Set;
+
+import com.hierynomus.msdtyp.AccessMask;
+import com.hierynomus.msfscc.FileAttributes;
+import com.hierynomus.mssmb2.SMB2CreateDisposition;
+import com.hierynomus.mssmb2.SMB2CreateOptions;
+import com.hierynomus.mssmb2.SMB2ShareAccess;
+
+public interface SmbIOBean {
+
+ /**
+ * The access mask to use when opening a file
+ *
+ * @return
+ */
+ Set<AccessMask> accessMask();
+
+ /**
+ * The attributes to request when opening a file
+ *
+ * @return
+ */
+ Set<FileAttributes> attributes();
+
+ /**
+ * The share access to request when opening a file
+ *
+ * @return
+ */
+ Set<SMB2ShareAccess> shareAccesses();
+
+ /**
+ * The create disposition to use when opening a file
+ *
+ * @return
+ */
+ SMB2CreateDisposition createDisposition();
+
+ /**
+ * The file create options (if applicable)
+ *
+ * @return
+ */
+ Set<SMB2CreateOptions> createOptions();
+
+}
diff --git a/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbReadBean.java b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbReadBean.java
new file mode 100644
index 00000000000..9f551b9f4d1
--- /dev/null
+++ b/components/camel-smb/src/main/java/org/apache/camel/component/smb/SmbReadBean.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.smb;
+
+import java.util.EnumSet;
+import java.util.Set;
+
+import com.hierynomus.msdtyp.AccessMask;
+import com.hierynomus.msfscc.FileAttributes;
+import com.hierynomus.mssmb2.SMB2CreateDisposition;
+import com.hierynomus.mssmb2.SMB2CreateOptions;
+import com.hierynomus.mssmb2.SMB2ShareAccess;
+
+public class SmbReadBean implements SmbIOBean {
+
+ @Override
+ public Set<AccessMask> accessMask() {
+ return EnumSet.of(AccessMask.GENERIC_READ);
+ }
+
+ @Override
+ public Set<FileAttributes> attributes() {
+ return EnumSet.of(FileAttributes.FILE_ATTRIBUTE_NORMAL);
+ }
+
+ @Override
+ public Set<SMB2ShareAccess> shareAccesses() {
+ return EnumSet.of(SMB2ShareAccess.FILE_SHARE_READ);
+ }
+
+ @Override
+ public SMB2CreateDisposition createDisposition() {
+ return SMB2CreateDisposition.FILE_OPEN;
+ }
+
+ @Override
+ public Set<SMB2CreateOptions> createOptions() {
+ return EnumSet.noneOf(SMB2CreateOptions.class);
+ }
+}
diff --git a/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentIT.java b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentIT.java
new file mode 100644
index 00000000000..8cb4657a932
--- /dev/null
+++ b/components/camel-smb/src/test/java/org/apache/camel/component/smb/SmbComponentIT.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.smb;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import com.hierynomus.smbj.share.File;
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.test.infra.smb.services.SmbService;
+import org.apache.camel.test.infra.smb.services.SmbServiceFactory;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.RegisterExtension;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SmbComponentIT extends CamelTestSupport {
+
+ @RegisterExtension
+ public static SmbService service = SmbServiceFactory.createService();
+ private static final Logger LOG = LoggerFactory.getLogger(SmbComponentIT.class);
+
+ @Test
+ public void testSmbRead() throws Exception {
+ MockEndpoint mock = getMockEndpoint("mock:result");
+ mock.expectedMessageCount(100);
+
+ mock.assertIsSatisfied();
+ }
+
+ @Override
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ private void process(Exchange exchange) throws IOException {
+ final File file = exchange.getMessage().getBody(File.class);
+ try (InputStream inputStream = file.getInputStream()) {
+
+ LOG.debug("Read exchange: {}, with contents: {}", file.getPath(),
+ new String(inputStream.readAllBytes()));
+ }
+ }
+
+ public void configure() {
+ fromF("smb:%s/%s?username=%s&password=%s&path=/", service.address(), service.shareName(),
+ service.userName(), service.password())
+ .process(this::process)
+ .to("mock:result");
+ }
+ };
+ }
+}
diff --git a/components/camel-smb/src/test/resources/log4j2.properties b/components/camel-smb/src/test/resources/log4j2.properties
new file mode 100644
index 00000000000..38b39e5b760
--- /dev/null
+++ b/components/camel-smb/src/test/resources/log4j2.properties
@@ -0,0 +1,35 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+
+appender.out.type = File
+appender.out.name = out
+appender.out.fileName = target/camel-smb-test.log
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+appender.stdout.type = Console
+appender.stdout.name = stdout
+appender.stdout.layout.type = PatternLayout
+appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+
+rootLogger.level = WARN
+rootLogger.appenderRef.out.ref = out
+
+logger.camel.name=org.apache.camel
+logger.camel.level=INFO
+
+logger.camel-smb.name=org.apache.camel.component.smb
+logger.camel-smb.level=DEBUG
\ No newline at end of file
diff --git a/components/pom.xml b/components/pom.xml
index cf2ddf68bac..aa3c642097c 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -287,6 +287,7 @@
<module>camel-sjms2</module>
<module>camel-sjms</module>
<module>camel-slack</module>
+ <module>camel-smb</module>
<module>camel-smpp</module>
<module>camel-snakeyaml</module>
<module>camel-snmp</module>
diff --git a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
index 242856e2180..41c6a3ea79a 100644
--- a/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
+++ b/core/camel-main/src/generated/resources/org/apache/camel/main/components.properties
@@ -285,6 +285,7 @@ sftp
sjms
sjms2
slack
+smb
smpp
smpps
smtp
diff --git a/docs/components/modules/ROOT/examples/json/smb.json b/docs/components/modules/ROOT/examples/json/smb.json
new file mode 120000
index 00000000000..0cc6d767369
--- /dev/null
+++ b/docs/components/modules/ROOT/examples/json/smb.json
@@ -0,0 +1 @@
+../../../../../../components/camel-smb/src/generated/resources/org/apache/camel/component/smb/smb.json
\ No newline at end of file
diff --git a/docs/components/modules/ROOT/nav.adoc b/docs/components/modules/ROOT/nav.adoc
index f3848a276e2..ee2a5cd7c77 100644
--- a/docs/components/modules/ROOT/nav.adoc
+++ b/docs/components/modules/ROOT/nav.adoc
@@ -294,6 +294,7 @@
** xref:sjms-component.adoc[Simple JMS]
** xref:sjms2-component.adoc[Simple JMS2]
** xref:slack-component.adoc[Slack]
+** xref:smb-component.adoc[SMB]
** xref:smpp-component.adoc[SMPP]
** xref:snmp-component.adoc[SNMP]
** xref:solr-component.adoc[Solr]
diff --git a/docs/components/modules/ROOT/pages/smb-component.adoc b/docs/components/modules/ROOT/pages/smb-component.adoc
new file mode 120000
index 00000000000..869cb96d1c1
--- /dev/null
+++ b/docs/components/modules/ROOT/pages/smb-component.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-smb/src/main/docs/smb-component.adoc
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
index 66c54603e16..788779f2a7b 100644
--- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/ComponentsBuilderFactory.java
@@ -3871,6 +3871,19 @@ public interface ComponentsBuilderFactory {
static org.apache.camel.builder.component.dsl.SlackComponentBuilderFactory.SlackComponentBuilder slack() {
return org.apache.camel.builder.component.dsl.SlackComponentBuilderFactory.slack();
}
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * @return the dsl builder
+ */
+ static org.apache.camel.builder.component.dsl.SmbComponentBuilderFactory.SmbComponentBuilder smb() {
+ return org.apache.camel.builder.component.dsl.SmbComponentBuilderFactory.smb();
+ }
/**
* SMPP (camel-smpp)
* Send and receive SMS messages using a SMSC (Short Message Service
diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmbComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmbComponentBuilderFactory.java
new file mode 100644
index 00000000000..d792ea0b15f
--- /dev/null
+++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/SmbComponentBuilderFactory.java
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.component.dsl;
+
+import javax.annotation.Generated;
+import org.apache.camel.Component;
+import org.apache.camel.builder.component.AbstractComponentBuilder;
+import org.apache.camel.builder.component.ComponentBuilder;
+import org.apache.camel.component.smb.SmbComponent;
+
+/**
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Generated by camel-package-maven-plugin - do not edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.ComponentDslMojo")
+public interface SmbComponentBuilderFactory {
+
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * @return the dsl builder
+ */
+ static SmbComponentBuilder smb() {
+ return new SmbComponentBuilderImpl();
+ }
+
+ /**
+ * Builder for the SMB component.
+ */
+ interface SmbComponentBuilder extends ComponentBuilder<SmbComponent> {
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. By default the
+ * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
+ * with exceptions, that will be logged at WARN or ERROR level and
+ * ignored.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default SmbComponentBuilder bridgeErrorHandler(
+ boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * Whether autowiring is enabled. This is used for automatic autowiring
+ * options (the option must be marked as autowired) by looking up in the
+ * registry to find if there is a single instance of matching type,
+ * which then gets configured on the component. This can be used for
+ * automatic configuring JDBC data sources, JMS connection factories,
+ * AWS Clients, etc.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: advanced
+ *
+ * @param autowiredEnabled the value to set
+ * @return the dsl builder
+ */
+ default SmbComponentBuilder autowiredEnabled(boolean autowiredEnabled) {
+ doSetProperty("autowiredEnabled", autowiredEnabled);
+ return this;
+ }
+ }
+
+ class SmbComponentBuilderImpl
+ extends
+ AbstractComponentBuilder<SmbComponent>
+ implements
+ SmbComponentBuilder {
+ @Override
+ protected SmbComponent buildConcreteComponent() {
+ return new SmbComponent();
+ }
+ @Override
+ protected boolean setPropertyOnComponent(
+ Component component,
+ String name,
+ Object value) {
+ switch (name) {
+ case "bridgeErrorHandler": ((SmbComponent) component).setBridgeErrorHandler((boolean) value); return true;
+ case "autowiredEnabled": ((SmbComponent) component).setAutowiredEnabled((boolean) value); return true;
+ default: return false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-componentdsl/src/generated/resources/metadata.json b/dsl/camel-componentdsl/src/generated/resources/metadata.json
index 1013120ce38..cc7fff83796 100644
--- a/dsl/camel-componentdsl/src/generated/resources/metadata.json
+++ b/dsl/camel-componentdsl/src/generated/resources/metadata.json
@@ -6361,6 +6361,28 @@
"producerOnly": false,
"lenientProperties": false
},
+ "SmbComponentBuilderFactory": {
+ "kind": "component",
+ "name": "smb",
+ "title": "SMB",
+ "description": "Receive files from SMB (Server Message Block) shares.",
+ "deprecated": false,
+ "firstVersion": "3.22.0",
+ "label": "file",
+ "javaType": "org.apache.camel.component.smb.SmbComponent",
+ "supportLevel": "Preview",
+ "groupId": "org.apache.camel",
+ "artifactId": "camel-smb",
+ "version": "3.22.0-SNAPSHOT",
+ "scheme": "smb",
+ "extendsScheme": "",
+ "syntax": "smb:hostname:port\/shareName",
+ "async": false,
+ "api": false,
+ "consumerOnly": true,
+ "producerOnly": false,
+ "lenientProperties": false
+ },
"SmppComponentBuilderFactory": {
"kind": "component",
"name": "smpp",
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
index f1d3d4be6c3..6d23c75ca9e 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilderFactory.java
@@ -306,6 +306,7 @@ public interface EndpointBuilderFactory
org.apache.camel.builder.endpoint.dsl.Sjms2EndpointBuilderFactory.Sjms2Builders,
org.apache.camel.builder.endpoint.dsl.SjmsEndpointBuilderFactory.SjmsBuilders,
org.apache.camel.builder.endpoint.dsl.SlackEndpointBuilderFactory.SlackBuilders,
+ org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory.SmbBuilders,
org.apache.camel.builder.endpoint.dsl.SmppEndpointBuilderFactory.SmppBuilders,
org.apache.camel.builder.endpoint.dsl.SnmpEndpointBuilderFactory.SnmpBuilders,
org.apache.camel.builder.endpoint.dsl.Sns2EndpointBuilderFactory.Sns2Builders,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
index f26311119a1..41a958b8d86 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/EndpointBuilders.java
@@ -303,6 +303,7 @@ public interface EndpointBuilders
org.apache.camel.builder.endpoint.dsl.Sjms2EndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.SjmsEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.SlackEndpointBuilderFactory,
+ org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.SmppEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.SnmpEndpointBuilderFactory,
org.apache.camel.builder.endpoint.dsl.Sns2EndpointBuilderFactory,
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
index 9ac6e30b95a..de642bdfdd6 100644
--- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/StaticEndpointBuilders.java
@@ -13510,6 +13510,63 @@ public class StaticEndpointBuilders {
String path) {
return org.apache.camel.builder.endpoint.dsl.SlackEndpointBuilderFactory.endpointBuilder(componentName, path);
}
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * Syntax: <code>smb:hostname:port/shareName</code>
+ *
+ * Path parameter: hostname (required)
+ * The share hostname or IP address
+ *
+ * Path parameter: port
+ * The share port number
+ * Default value: 445
+ *
+ * Path parameter: shareName
+ * The name of the share to connect to.
+ *
+ * @param path hostname:port/shareName
+ * @return the dsl builder
+ */
+ public static org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory.SmbEndpointBuilder smb(
+ String path) {
+ return org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory.endpointBuilder("smb", path);
+ }
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * Syntax: <code>smb:hostname:port/shareName</code>
+ *
+ * Path parameter: hostname (required)
+ * The share hostname or IP address
+ *
+ * Path parameter: port
+ * The share port number
+ * Default value: 445
+ *
+ * Path parameter: shareName
+ * The name of the share to connect to.
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path hostname:port/shareName
+ * @return the dsl builder
+ */
+ public static org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory.SmbEndpointBuilder smb(
+ String componentName,
+ String path) {
+ return org.apache.camel.builder.endpoint.dsl.SmbEndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
/**
* SMPP (camel-smpp)
* Send and receive SMS messages using a SMSC (Short Message Service
diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmbEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmbEndpointBuilderFactory.java
new file mode 100644
index 00000000000..12129d52315
--- /dev/null
+++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SmbEndpointBuilderFactory.java
@@ -0,0 +1,919 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.builder.endpoint.dsl;
+
+import java.util.*;
+import java.util.Map;
+import java.util.concurrent.*;
+import java.util.function.*;
+import java.util.stream.*;
+import javax.annotation.Generated;
+import org.apache.camel.builder.EndpointConsumerBuilder;
+import org.apache.camel.builder.EndpointProducerBuilder;
+import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
+
+/**
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Generated by camel build tools - do NOT edit this file!
+ */
+@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
+public interface SmbEndpointBuilderFactory {
+
+
+ /**
+ * Builder for endpoint for the SMB component.
+ */
+ public interface SmbEndpointBuilder extends EndpointConsumerBuilder {
+ default AdvancedSmbEndpointBuilder advanced() {
+ return (AdvancedSmbEndpointBuilder) this;
+ }
+ /**
+ * The path, within the share, to consume the files from.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Required: true
+ * Group: consumer
+ *
+ * @param path the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder path(String path) {
+ doSetProperty("path", path);
+ return this;
+ }
+ /**
+ * The search pattern used to list the files.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Default: *.txt
+ * Group: consumer
+ *
+ * @param searchPattern the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder searchPattern(String searchPattern) {
+ doSetProperty("searchPattern", searchPattern);
+ return this;
+ }
+ /**
+ * If the polling consumer did not poll any files, you can enable this
+ * option to send an empty message (no body) instead.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param sendEmptyMessageWhenIdle the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder sendEmptyMessageWhenIdle(
+ boolean sendEmptyMessageWhenIdle) {
+ doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle);
+ return this;
+ }
+ /**
+ * If the polling consumer did not poll any files, you can enable this
+ * option to send an empty message (no body) instead.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: consumer
+ *
+ * @param sendEmptyMessageWhenIdle the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder sendEmptyMessageWhenIdle(
+ String sendEmptyMessageWhenIdle) {
+ doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle);
+ return this;
+ }
+ /**
+ * The number of subsequent error polls (failed due some error) that
+ * should happen before the backoffMultipler should kick-in.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffErrorThreshold the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffErrorThreshold(
+ int backoffErrorThreshold) {
+ doSetProperty("backoffErrorThreshold", backoffErrorThreshold);
+ return this;
+ }
+ /**
+ * The number of subsequent error polls (failed due some error) that
+ * should happen before the backoffMultipler should kick-in.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffErrorThreshold the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffErrorThreshold(
+ String backoffErrorThreshold) {
+ doSetProperty("backoffErrorThreshold", backoffErrorThreshold);
+ return this;
+ }
+ /**
+ * The number of subsequent idle polls that should happen before the
+ * backoffMultipler should kick-in.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffIdleThreshold the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffIdleThreshold(int backoffIdleThreshold) {
+ doSetProperty("backoffIdleThreshold", backoffIdleThreshold);
+ return this;
+ }
+ /**
+ * The number of subsequent idle polls that should happen before the
+ * backoffMultipler should kick-in.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffIdleThreshold the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffIdleThreshold(
+ String backoffIdleThreshold) {
+ doSetProperty("backoffIdleThreshold", backoffIdleThreshold);
+ return this;
+ }
+ /**
+ * To let the scheduled polling consumer backoff if there has been a
+ * number of subsequent idles/errors in a row. The multiplier is then
+ * the number of polls that will be skipped before the next actual
+ * attempt is happening again. When this option is in use then
+ * backoffIdleThreshold and/or backoffErrorThreshold must also be
+ * configured.
+ *
+ * The option is a: <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffMultiplier the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffMultiplier(int backoffMultiplier) {
+ doSetProperty("backoffMultiplier", backoffMultiplier);
+ return this;
+ }
+ /**
+ * To let the scheduled polling consumer backoff if there has been a
+ * number of subsequent idles/errors in a row. The multiplier is then
+ * the number of polls that will be skipped before the next actual
+ * attempt is happening again. When this option is in use then
+ * backoffIdleThreshold and/or backoffErrorThreshold must also be
+ * configured.
+ *
+ * The option will be converted to a <code>int</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param backoffMultiplier the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder backoffMultiplier(String backoffMultiplier) {
+ doSetProperty("backoffMultiplier", backoffMultiplier);
+ return this;
+ }
+ /**
+ * Milliseconds before the next poll.
+ *
+ * The option is a: <code>long</code> type.
+ *
+ * Default: 500
+ * Group: scheduler
+ *
+ * @param delay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder delay(long delay) {
+ doSetProperty("delay", delay);
+ return this;
+ }
+ /**
+ * Milliseconds before the next poll.
+ *
+ * The option will be converted to a <code>long</code> type.
+ *
+ * Default: 500
+ * Group: scheduler
+ *
+ * @param delay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder delay(String delay) {
+ doSetProperty("delay", delay);
+ return this;
+ }
+ /**
+ * If greedy is enabled, then the ScheduledPollConsumer will run
+ * immediately again, if the previous run polled 1 or more messages.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: scheduler
+ *
+ * @param greedy the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder greedy(boolean greedy) {
+ doSetProperty("greedy", greedy);
+ return this;
+ }
+ /**
+ * If greedy is enabled, then the ScheduledPollConsumer will run
+ * immediately again, if the previous run polled 1 or more messages.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: scheduler
+ *
+ * @param greedy the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder greedy(String greedy) {
+ doSetProperty("greedy", greedy);
+ return this;
+ }
+ /**
+ * Milliseconds before the first poll starts.
+ *
+ * The option is a: <code>long</code> type.
+ *
+ * Default: 1000
+ * Group: scheduler
+ *
+ * @param initialDelay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder initialDelay(long initialDelay) {
+ doSetProperty("initialDelay", initialDelay);
+ return this;
+ }
+ /**
+ * Milliseconds before the first poll starts.
+ *
+ * The option will be converted to a <code>long</code> type.
+ *
+ * Default: 1000
+ * Group: scheduler
+ *
+ * @param initialDelay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder initialDelay(String initialDelay) {
+ doSetProperty("initialDelay", initialDelay);
+ return this;
+ }
+ /**
+ * Specifies a maximum limit of number of fires. So if you set it to 1,
+ * the scheduler will only fire once. If you set it to 5, it will only
+ * fire five times. A value of zero or negative means fire forever.
+ *
+ * The option is a: <code>long</code> type.
+ *
+ * Default: 0
+ * Group: scheduler
+ *
+ * @param repeatCount the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder repeatCount(long repeatCount) {
+ doSetProperty("repeatCount", repeatCount);
+ return this;
+ }
+ /**
+ * Specifies a maximum limit of number of fires. So if you set it to 1,
+ * the scheduler will only fire once. If you set it to 5, it will only
+ * fire five times. A value of zero or negative means fire forever.
+ *
+ * The option will be converted to a <code>long</code> type.
+ *
+ * Default: 0
+ * Group: scheduler
+ *
+ * @param repeatCount the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder repeatCount(String repeatCount) {
+ doSetProperty("repeatCount", repeatCount);
+ return this;
+ }
+ /**
+ * The consumer logs a start/complete log line when it polls. This
+ * option allows you to configure the logging level for that.
+ *
+ * The option is a:
+ * <code>org.apache.camel.LoggingLevel</code> type.
+ *
+ * Default: TRACE
+ * Group: scheduler
+ *
+ * @param runLoggingLevel the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder runLoggingLevel(
+ org.apache.camel.LoggingLevel runLoggingLevel) {
+ doSetProperty("runLoggingLevel", runLoggingLevel);
+ return this;
+ }
+ /**
+ * The consumer logs a start/complete log line when it polls. This
+ * option allows you to configure the logging level for that.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.LoggingLevel</code> type.
+ *
+ * Default: TRACE
+ * Group: scheduler
+ *
+ * @param runLoggingLevel the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder runLoggingLevel(String runLoggingLevel) {
+ doSetProperty("runLoggingLevel", runLoggingLevel);
+ return this;
+ }
+ /**
+ * Allows for configuring a custom/shared thread pool to use for the
+ * consumer. By default each consumer has its own single threaded thread
+ * pool.
+ *
+ * The option is a:
+ * <code>java.util.concurrent.ScheduledExecutorService</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param scheduledExecutorService the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder scheduledExecutorService(
+ ScheduledExecutorService scheduledExecutorService) {
+ doSetProperty("scheduledExecutorService", scheduledExecutorService);
+ return this;
+ }
+ /**
+ * Allows for configuring a custom/shared thread pool to use for the
+ * consumer. By default each consumer has its own single threaded thread
+ * pool.
+ *
+ * The option will be converted to a
+ * <code>java.util.concurrent.ScheduledExecutorService</code> type.
+ *
+ * Group: scheduler
+ *
+ * @param scheduledExecutorService the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder scheduledExecutorService(
+ String scheduledExecutorService) {
+ doSetProperty("scheduledExecutorService", scheduledExecutorService);
+ return this;
+ }
+ /**
+ * To use a cron scheduler from either camel-spring or camel-quartz
+ * component. Use value spring or quartz for built in scheduler.
+ *
+ * The option is a: <code>java.lang.Object</code> type.
+ *
+ * Default: none
+ * Group: scheduler
+ *
+ * @param scheduler the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder scheduler(Object scheduler) {
+ doSetProperty("scheduler", scheduler);
+ return this;
+ }
+ /**
+ * To use a cron scheduler from either camel-spring or camel-quartz
+ * component. Use value spring or quartz for built in scheduler.
+ *
+ * The option will be converted to a
+ * <code>java.lang.Object</code> type.
+ *
+ * Default: none
+ * Group: scheduler
+ *
+ * @param scheduler the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder scheduler(String scheduler) {
+ doSetProperty("scheduler", scheduler);
+ return this;
+ }
+ /**
+ * To configure additional properties when using a custom scheduler or
+ * any of the Quartz, Spring based scheduler.
+ *
+ * The option is a: <code>java.util.Map&lt;java.lang.String,
+ * java.lang.Object&gt;</code> type.
+ * The option is multivalued, and you can use the
+ * schedulerProperties(String, Object) method to add a value (call the
+ * method multiple times to set more values).
+ *
+ * Group: scheduler
+ *
+ * @param key the option key
+ * @param value the option value
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder schedulerProperties(String key, Object value) {
+ doSetMultiValueProperty("schedulerProperties", "scheduler." + key, value);
+ return this;
+ }
+ /**
+ * To configure additional properties when using a custom scheduler or
+ * any of the Quartz, Spring based scheduler.
+ *
+ * The option is a: <code>java.util.Map&lt;java.lang.String,
+ * java.lang.Object&gt;</code> type.
+ * The option is multivalued, and you can use the
+ * schedulerProperties(String, Object) method to add a value (call the
+ * method multiple times to set more values).
+ *
+ * Group: scheduler
+ *
+ * @param values the values
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder schedulerProperties(Map values) {
+ doSetMultiValueProperties("schedulerProperties", "scheduler.", values);
+ return this;
+ }
+ /**
+ * Whether the scheduler should be auto started.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: scheduler
+ *
+ * @param startScheduler the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder startScheduler(boolean startScheduler) {
+ doSetProperty("startScheduler", startScheduler);
+ return this;
+ }
+ /**
+ * Whether the scheduler should be auto started.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: true
+ * Group: scheduler
+ *
+ * @param startScheduler the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder startScheduler(String startScheduler) {
+ doSetProperty("startScheduler", startScheduler);
+ return this;
+ }
+ /**
+ * Time unit for initialDelay and delay options.
+ *
+ * The option is a:
+ * <code>java.util.concurrent.TimeUnit</code> type.
+ *
+ * Default: MILLISECONDS
+ * Group: scheduler
+ *
+ * @param timeUnit the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder timeUnit(TimeUnit timeUnit) {
+ doSetProperty("timeUnit", timeUnit);
+ return this;
+ }
+ /**
+ * Time unit for initialDelay and delay options.
+ *
+ * The option will be converted to a
+ * <code>java.util.concurrent.TimeUnit</code> type.
+ *
+ * Default: MILLISECONDS
+ * Group: scheduler
+ *
+ * @param timeUnit the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder timeUnit(String timeUnit) {
+ doSetProperty("timeUnit", timeUnit);
+ return this;
+ }
+ /**
+ * Controls if fixed delay or fixed rate is used. See
+ * ScheduledExecutorService in JDK for details.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: true
+ * Group: scheduler
+ *
+ * @param useFixedDelay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder useFixedDelay(boolean useFixedDelay) {
+ doSetProperty("useFixedDelay", useFixedDelay);
+ return this;
+ }
+ /**
+ * Controls if fixed delay or fixed rate is used. See
+ * ScheduledExecutorService in JDK for details.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: true
+ * Group: scheduler
+ *
+ * @param useFixedDelay the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder useFixedDelay(String useFixedDelay) {
+ doSetProperty("useFixedDelay", useFixedDelay);
+ return this;
+ }
+ /**
+ * The user domain.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param domain the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder domain(String domain) {
+ doSetProperty("domain", domain);
+ return this;
+ }
+ /**
+ * The password to access the share.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param password the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder password(String password) {
+ doSetProperty("password", password);
+ return this;
+ }
+ /**
+ * The username required to access the share.
+ *
+ * The option is a: <code>java.lang.String</code> type.
+ *
+ * Group: security
+ *
+ * @param username the value to set
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder username(String username) {
+ doSetProperty("username", username);
+ return this;
+ }
+ }
+
+ /**
+ * Advanced builder for endpoint for the SMB component.
+ */
+ public interface AdvancedSmbEndpointBuilder
+ extends
+ EndpointConsumerBuilder {
+ default SmbEndpointBuilder basic() {
+ return (SmbEndpointBuilder) this;
+ }
+ /**
+ * A pluggable repository org.apache.camel.spi.IdempotentRepository
+ * which by default use MemoryIdempotentRepository if none is specified.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.IdempotentRepository</code>
+ * type.
+ *
+ * Group: consumer
+ *
+ * @param idempotentRepository the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder idempotentRepository(
+ org.apache.camel.spi.IdempotentRepository idempotentRepository) {
+ doSetProperty("idempotentRepository", idempotentRepository);
+ return this;
+ }
+ /**
+ * A pluggable repository org.apache.camel.spi.IdempotentRepository
+ * which by default use MemoryIdempotentRepository if none is specified.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.spi.IdempotentRepository</code>
+ * type.
+ *
+ * Group: consumer
+ *
+ * @param idempotentRepository the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder idempotentRepository(
+ String idempotentRepository) {
+ doSetProperty("idempotentRepository", idempotentRepository);
+ return this;
+ }
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. By default the
+ * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
+ * with exceptions, that will be logged at WARN or ERROR level and
+ * ignored.
+ *
+ * The option is a: <code>boolean</code> type.
+ *
+ * Default: false
+ * Group: consumer (advanced)
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder bridgeErrorHandler(
+ boolean bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * Allows for bridging the consumer to the Camel routing Error Handler,
+ * which mean any exceptions occurred while the consumer is trying to
+ * pickup incoming messages, or the likes, will now be processed as a
+ * message and handled by the routing Error Handler. By default the
+ * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
+ * with exceptions, that will be logged at WARN or ERROR level and
+ * ignored.
+ *
+ * The option will be converted to a <code>boolean</code>
+ * type.
+ *
+ * Default: false
+ * Group: consumer (advanced)
+ *
+ * @param bridgeErrorHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder bridgeErrorHandler(
+ String bridgeErrorHandler) {
+ doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
+ return this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.ExceptionHandler</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder exceptionHandler(
+ org.apache.camel.spi.ExceptionHandler exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * To let the consumer use a custom ExceptionHandler. Notice if the
+ * option bridgeErrorHandler is enabled then this option is not in use.
+ * By default the consumer will deal with exceptions, that will be
+ * logged at WARN or ERROR level and ignored.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.spi.ExceptionHandler</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exceptionHandler the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder exceptionHandler(
+ String exceptionHandler) {
+ doSetProperty("exceptionHandler", exceptionHandler);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option is a:
+ * <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder exchangePattern(
+ org.apache.camel.ExchangePattern exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ /**
+ * Sets the exchange pattern when the consumer creates an exchange.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.ExchangePattern</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param exchangePattern the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder exchangePattern(
+ String exchangePattern) {
+ doSetProperty("exchangePattern", exchangePattern);
+ return this;
+ }
+ /**
+ * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing
+ * you to provide your custom implementation to control error handling
+ * usually occurred during the poll operation before an Exchange have
+ * been created and being routed in Camel.
+ *
+ * The option is a:
+ * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param pollStrategy the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder pollStrategy(
+ org.apache.camel.spi.PollingConsumerPollStrategy pollStrategy) {
+ doSetProperty("pollStrategy", pollStrategy);
+ return this;
+ }
+ /**
+ * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing
+ * you to provide your custom implementation to control error handling
+ * usually occurred during the poll operation before an Exchange have
+ * been created and being routed in Camel.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type.
+ *
+ * Group: consumer (advanced)
+ *
+ * @param pollStrategy the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder pollStrategy(String pollStrategy) {
+ doSetProperty("pollStrategy", pollStrategy);
+ return this;
+ }
+ /**
+ * An optional SMB I/O bean to use to setup the file access attributes
+ * when reading/writing a file.
+ *
+ * The option is a:
+ * <code>org.apache.camel.component.smb.SmbIOBean</code>
+ * type.
+ *
+ * Group: advanced
+ *
+ * @param smbIoBean the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder smbIoBean(
+ org.apache.camel.component.smb.SmbIOBean smbIoBean) {
+ doSetProperty("smbIoBean", smbIoBean);
+ return this;
+ }
+ /**
+ * An optional SMB I/O bean to use to setup the file access attributes
+ * when reading/writing a file.
+ *
+ * The option will be converted to a
+ * <code>org.apache.camel.component.smb.SmbIOBean</code>
+ * type.
+ *
+ * Group: advanced
+ *
+ * @param smbIoBean the value to set
+ * @return the dsl builder
+ */
+ default AdvancedSmbEndpointBuilder smbIoBean(String smbIoBean) {
+ doSetProperty("smbIoBean", smbIoBean);
+ return this;
+ }
+ }
+
+ public interface SmbBuilders {
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * Syntax: <code>smb:hostname:port/shareName</code>
+ *
+ * Path parameter: hostname (required)
+ * The share hostname or IP address
+ *
+ * Path parameter: port
+ * The share port number
+ * Default value: 445
+ *
+ * Path parameter: shareName
+ * The name of the share to connect to.
+ *
+ * @param path hostname:port/shareName
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder smb(String path) {
+ return SmbEndpointBuilderFactory.endpointBuilder("smb", path);
+ }
+ /**
+ * SMB (camel-smb)
+ * Receive files from SMB (Server Message Block) shares.
+ *
+ * Category: file
+ * Since: 3.22
+ * Maven coordinates: org.apache.camel:camel-smb
+ *
+ * Syntax: <code>smb:hostname:port/shareName</code>
+ *
+ * Path parameter: hostname (required)
+ * The share hostname or IP address
+ *
+ * Path parameter: port
+ * The share port number
+ * Default value: 445
+ *
+ * Path parameter: shareName
+ * The name of the share to connect to.
+ *
+ * @param componentName to use a custom component name for the endpoint
+ * instead of the default name
+ * @param path hostname:port/shareName
+ * @return the dsl builder
+ */
+ default SmbEndpointBuilder smb(String componentName, String path) {
+ return SmbEndpointBuilderFactory.endpointBuilder(componentName, path);
+ }
+ }
+ static SmbEndpointBuilder endpointBuilder(String componentName, String path) {
+ class SmbEndpointBuilderImpl extends AbstractEndpointBuilder implements SmbEndpointBuilder, AdvancedSmbEndpointBuilder {
+ public SmbEndpointBuilderImpl(String path) {
+ super(componentName, path);
+ }
+ }
+ return new SmbEndpointBuilderImpl(path);
+ }
+}
\ No newline at end of file
diff --git a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
index 6b557c392c8..ec6fbfee970 100644
--- a/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
+++ b/dsl/camel-kamelet-main/src/generated/resources/camel-component-known-dependencies.properties
@@ -295,6 +295,7 @@ org.apache.camel.component.servlet.ServletComponent=camel:servlet
org.apache.camel.component.sjms.SjmsComponent=camel:sjms
org.apache.camel.component.sjms2.Sjms2Component=camel:sjms2
org.apache.camel.component.slack.SlackComponent=camel:slack
+org.apache.camel.component.smb.SmbComponent=camel:smb
org.apache.camel.component.smpp.SmppComponent=camel:smpp
org.apache.camel.component.snmp.SnmpComponent=camel:snmp
org.apache.camel.component.solr.SolrComponent=camel:solr
diff --git a/parent/pom.xml b/parent/pom.xml
index 694f1fc69c7..b8318a36f2b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -495,6 +495,7 @@
<smallrye-metrics-version>3.0.5</smallrye-metrics-version>
<smallrye-health-version>3.3.0</smallrye-health-version>
<smallrye-fault-tolerance-version>5.6.0</smallrye-fault-tolerance-version>
+ <smbj-version>0.12.0</smbj-version>
<snakeyaml-version>1.33</snakeyaml-version>
<snakeyaml-engine-version>2.3</snakeyaml-engine-version>
<snappy-java-version>1.1.10.3</snappy-java-version>
@@ -2316,6 +2317,11 @@
<artifactId>camel-slack</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-smb</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-smpp</artifactId>
diff --git a/test-infra/camel-test-infra-smb/pom.xml b/test-infra/camel-test-infra-smb/pom.xml
new file mode 100644
index 00000000000..9e79b108c6d
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>camel-test-infra-parent</artifactId>
+ <groupId>org.apache.camel</groupId>
+ <relativePath>../camel-test-infra-parent/pom.xml</relativePath>
+ <version>3.22.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-test-infra-smb</artifactId>
+ <name>Camel :: Test Infra :: Server Message Block</name>
+ <description>Server Message Block test infrastructure for Camel</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-infra-common</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>testcontainers</artifactId>
+ <version>${testcontainers-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-test-junit5</artifactId>
+ </dependency>
+ </dependencies>
+
+
+</project>
\ No newline at end of file
diff --git a/test-infra/camel-test-infra-smb/src/main/resources/META-INF/MANIFEST.MF b/test-infra/camel-test-infra-smb/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/common/SmbProperties.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
new file mode 100644
index 00000000000..7eb03b3e96e
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/common/SmbProperties.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.common;
+
+public final class SmbProperties {
+ public static final String SERVICE_ADDRESS = "smb.service.address";
+ public static final String SHARE_NAME = "smb.service.share";
+ public static final String SMB_USERNAME = "smb.service.username";
+ public static final String SMB_PASSWORD = "smb.service.password";
+
+ private SmbProperties() {
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbContainer.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
new file mode 100644
index 00000000000..b0981487a7e
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbContainer.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.services;
+
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.wait.strategy.Wait;
+import org.testcontainers.images.builder.ImageFromDockerfile;
+
+public class SmbContainer extends GenericContainer<SmbContainer> {
+
+ public static final int SMB_PORT_DEFAULT = 445;
+ public static final String DEFAULT_USER = "camel";
+ public static final String DEFAULT_PASSWORD = "camelTester123";
+
+ public SmbContainer() {
+ super(new ImageFromDockerfile("localhost/samba:camel", false)
+ .withFileFromClasspath(".",
+ "org/apache/camel/test/infra/smb/services/"));
+
+ super.withExposedPorts(SMB_PORT_DEFAULT)
+ .waitingFor(Wait.forListeningPort());
+ }
+
+ public String getUser() {
+ return DEFAULT_USER;
+ }
+
+ public String getPassword() {
+ return DEFAULT_PASSWORD;
+ }
+
+ public String getShare() {
+ return "data-rw";
+ }
+
+ public int getPort() {
+ return getMappedPort(SMB_PORT_DEFAULT);
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerService.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerService.java
new file mode 100644
index 00000000000..8fde98768c5
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbLocalContainerService.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.services;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SmbLocalContainerService implements SmbService {
+ private static final Logger LOG = LoggerFactory.getLogger(SmbLocalContainerService.class);
+ private final SmbContainer container = new SmbContainer();
+
+ public SmbLocalContainerService() {
+ }
+
+ @Override
+ public String address() {
+ return container.getHost() + ":" + container.getPort();
+ }
+
+ @Override
+ public String shareName() {
+ return container.getShare();
+ }
+
+ @Override
+ public String userName() {
+ return container.getUser();
+ }
+
+ @Override
+ public String password() {
+ return container.getPassword();
+ }
+
+ @Override
+ public void registerProperties() {
+
+ }
+
+ @Override
+ public void initialize() {
+ container.start();
+ registerProperties();
+
+ LOG.info("SMB host running at address {}:", address());
+ }
+
+ @Override
+ public void shutdown() {
+
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbRemoteService.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbRemoteService.java
new file mode 100644
index 00000000000..62de562a9c3
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbRemoteService.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.services;
+
+import org.apache.camel.test.infra.smb.common.SmbProperties;
+
+public class SmbRemoteService implements SmbService {
+ @Override
+ public String address() {
+ return System.getProperty(SmbProperties.SERVICE_ADDRESS);
+ }
+
+ @Override
+ public String shareName() {
+ return System.getProperty(SmbProperties.SHARE_NAME);
+ }
+
+ @Override
+ public String userName() {
+ return System.getProperty(SmbProperties.SMB_USERNAME);
+ }
+
+ @Override
+ public String password() {
+ return System.getProperty(SmbProperties.SMB_PASSWORD);
+ }
+
+ @Override
+ public void registerProperties() {
+
+ }
+
+ @Override
+ public void initialize() {
+
+ }
+
+ @Override
+ public void shutdown() {
+
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbService.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbService.java
new file mode 100644
index 00000000000..300f8bfd781
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbService.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.services;
+
+import org.apache.camel.test.infra.common.services.TestService;
+import org.junit.jupiter.api.extension.AfterAllCallback;
+import org.junit.jupiter.api.extension.BeforeAllCallback;
+import org.junit.jupiter.api.extension.ExtensionContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public interface SmbService extends BeforeAllCallback, AfterAllCallback, TestService {
+ String address();
+
+ String shareName();
+
+ String userName();
+
+ String password();
+
+ @Override
+ default void beforeAll(ExtensionContext extensionContext) {
+ try {
+ initialize();
+ } catch (Exception e) {
+ Logger log = LoggerFactory.getLogger(SmbService.class);
+
+ final Object o = extensionContext.getTestInstance().get();
+ log.error("Failed to initialize service {} for test {} on ({})", this.getClass().getSimpleName(),
+ extensionContext.getDisplayName(), o.getClass().getName());
+
+ throw e;
+ }
+ }
+
+ @Override
+ default void afterAll(ExtensionContext extensionContext) {
+ shutdown();
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbServiceFactory.java b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbServiceFactory.java
new file mode 100644
index 00000000000..3661402173d
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/java/org/apache/camel/test/infra/smb/services/SmbServiceFactory.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.test.infra.smb.services;
+
+import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;
+
+public final class SmbServiceFactory {
+
+ private SmbServiceFactory() {
+ }
+
+ public static SmbService createService() {
+ SimpleTestServiceBuilder<SmbService> builder = new SimpleTestServiceBuilder<>("smb");
+
+ return builder.addLocalMapping(SmbLocalContainerService::new)
+ .addRemoteMapping(SmbRemoteService::new)
+ .build();
+ }
+}
diff --git a/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/Dockerfile b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/Dockerfile
new file mode 100644
index 00000000000..5c7a8b5222e
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/Dockerfile
@@ -0,0 +1,26 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+FROM fedora:38 as samba
+LABEL maintainer="orpiske@apache.org"
+ENV SAMBA_ROOT /opt/camel/samba
+EXPOSE 139 445
+RUN dnf install -y samba && mkdir -p /data/rw /data/ro
+ADD smb.conf /etc/samba/smb.conf
+ADD start.sh /usr/local/bin
+RUN chmod +x /usr/local/bin/start.sh
+CMD /usr/local/bin/start.sh
\ No newline at end of file
diff --git a/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/smb.conf b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/smb.conf
new file mode 100644
index 00000000000..74ef80abdda
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/smb.conf
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+[global]
+ workgroup = SAMBA
+ security = user
+
+ passdb backend = tdbsam
+
+ printing = cups
+ printcap name = cups
+ load printers = yes
+ cups options = raw
+
+[homes]
+ comment = Home Directories
+ valid users = %S, %D%w%S
+ browseable = No
+ read only = No
+ inherit acls = Yes
+
+[printers]
+ comment = All Printers
+ path = /var/tmp
+ printable = Yes
+ create mask = 0600
+ browseable = No
+
+[print$]
+ comment = Printer Drivers
+ path = /var/lib/samba/drivers
+ write list = @printadmin root
+ force group = @printadmin
+ create mask = 0664
+ directory mask = 0775
+
+[data-rw]
+ comment = Read-write share for testing
+ path = /data/rw
+ read only = no
+ browsable = yes
+
+[data-ro]
+ comment = Read-only share for testing
+ path = /data/ro
+ read only = yes
+ browsable = yes
diff --git a/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/start.sh b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/start.sh
new file mode 100644
index 00000000000..2e1f950f656
--- /dev/null
+++ b/test-infra/camel-test-infra-smb/src/test/resources/org/apache/camel/test/infra/smb/services/start.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+echo "Creating read-writable files"
+for file in $(seq 1 100) ; do
+ echo ${RANDOM} > /data/rw/${file}.txt ;
+done
+
+echo "Creating read-only files"
+for file in $(seq 1 100) ; do
+ echo ${RANDOM} > /data/ro/${file}.txt ;
+done
+
+useradd camel
+printf "camelTester123\ncamelTester123\n" | smbpasswd -s -a camel
+
+chown -Rv camel /data/rw
+
+nmbd -D
+smbd -D -s /etc/samba/smb.conf
+
+while true ; do
+ sleep 10
+done
\ No newline at end of file
diff --git a/test-infra/pom.xml b/test-infra/pom.xml
index 166cd9a7bcb..81c77ab039e 100644
--- a/test-infra/pom.xml
+++ b/test-infra/pom.xml
@@ -77,5 +77,6 @@
<module>camel-test-infra-hashicorp-vault</module>
<module>camel-test-infra-jetty</module>
<module>camel-test-infra-etcd3</module>
+ <module>camel-test-infra-smb</module>
</modules>
</project>