Skip to content

Commit 4ad14c2

Browse files
committed
CAMEL-22379: Add Mina Sftp Component
1 parent a47b4c7 commit 4ad14c2

137 files changed

Lines changed: 24182 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bom/camel-bom/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1637,6 +1637,11 @@
16371637
<artifactId>camel-mina</artifactId>
16381638
<version>4.18.0-SNAPSHOT</version>
16391639
</dependency>
1640+
<dependency>
1641+
<groupId>org.apache.camel</groupId>
1642+
<artifactId>camel-mina-sftp</artifactId>
1643+
<version>4.18.0-SNAPSHOT</version>
1644+
</dependency>
16401645
<dependency>
16411646
<groupId>org.apache.camel</groupId>
16421647
<artifactId>camel-minio</artifactId>

catalog/camel-allcomponents/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,6 +1437,11 @@
14371437
<artifactId>camel-mina</artifactId>
14381438
<version>${project.version}</version>
14391439
</dependency>
1440+
<dependency>
1441+
<groupId>org.apache.camel</groupId>
1442+
<artifactId>camel-mina-sftp</artifactId>
1443+
<version>${project.version}</version>
1444+
</dependency>
14401445
<dependency>
14411446
<groupId>org.apache.camel</groupId>
14421447
<artifactId>camel-minio</artifactId>

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ milo-client
251251
milo-server
252252
milvus
253253
mina
254+
mina-sftp
254255
minio
255256
mllp
256257
mock

catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/mina-sftp.json

Lines changed: 194 additions & 0 deletions
Large diffs are not rendered by default.

components/camel-mina-sftp/pom.xml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one or more
5+
contributor license agreements. See the NOTICE file distributed with
6+
this work for additional information regarding copyright ownership.
7+
The ASF licenses this file to You under the Apache License, Version 2.0
8+
(the "License"); you may not use this file except in compliance with
9+
the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
<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">
21+
<modelVersion>4.0.0</modelVersion>
22+
23+
<parent>
24+
<groupId>org.apache.camel</groupId>
25+
<artifactId>components</artifactId>
26+
<version>4.18.0-SNAPSHOT</version>
27+
</parent>
28+
29+
<artifactId>camel-mina-sftp</artifactId>
30+
<packaging>jar</packaging>
31+
<name>Camel :: MINA SFTP</name>
32+
<description>Camel SFTP support using Apache MINA SSHD</description>
33+
34+
<properties>
35+
<camel.failsafe.parallel>true</camel.failsafe.parallel>
36+
</properties>
37+
38+
<dependencies>
39+
<!-- Core Camel dependencies -->
40+
<dependency>
41+
<groupId>org.apache.camel</groupId>
42+
<artifactId>camel-ftp</artifactId>
43+
<exclusions>
44+
<!-- Exclude JSch - we use Apache MINA SSHD instead -->
45+
<exclusion>
46+
<groupId>com.github.mwiede</groupId>
47+
<artifactId>jsch</artifactId>
48+
</exclusion>
49+
<!-- Exclude commons-net - we only support SFTP, not FTP/FTPS -->
50+
<exclusion>
51+
<groupId>commons-net</groupId>
52+
<artifactId>commons-net</artifactId>
53+
</exclusion>
54+
</exclusions>
55+
</dependency>
56+
<!-- Apache MINA SSHD for SFTP operations -->
57+
<dependency>
58+
<groupId>org.apache.sshd</groupId>
59+
<artifactId>sshd-sftp</artifactId>
60+
<version>${sshd-version}</version>
61+
</dependency>
62+
63+
<!-- testing -->
64+
<dependency>
65+
<groupId>org.apache.camel</groupId>
66+
<artifactId>camel-test-junit5</artifactId>
67+
<scope>test</scope>
68+
</dependency>
69+
<dependency>
70+
<groupId>org.apache.camel</groupId>
71+
<artifactId>camel-core-languages</artifactId>
72+
<scope>test</scope>
73+
</dependency>
74+
75+
<dependency>
76+
<groupId>com.github.mwiede</groupId>
77+
<artifactId>jsch</artifactId>
78+
<version>${jsch-version}</version>
79+
<scope>test</scope>
80+
</dependency>
81+
82+
<!-- needed for sftp server in tests -->
83+
<dependency>
84+
<groupId>org.bouncycastle</groupId>
85+
<artifactId>bcpg-jdk18on</artifactId>
86+
<version>${bouncycastle-version}</version>
87+
<scope>test</scope>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.bouncycastle</groupId>
91+
<artifactId>bcpkix-jdk18on</artifactId>
92+
<version>${bouncycastle-version}</version>
93+
<scope>test</scope>
94+
</dependency>
95+
96+
<!-- needed by sshd server -->
97+
<dependency>
98+
<groupId>org.apache.mina</groupId>
99+
<artifactId>mina-core</artifactId>
100+
<version>${mina-version}</version>
101+
<scope>test</scope>
102+
</dependency>
103+
104+
<dependency>
105+
<groupId>org.mockito</groupId>
106+
<artifactId>mockito-junit-jupiter</artifactId>
107+
<version>${mockito-version}</version>
108+
<scope>test</scope>
109+
</dependency>
110+
111+
<!-- test infra -->
112+
<dependency>
113+
<groupId>org.apache.camel</groupId>
114+
<artifactId>camel-test-infra-ftp</artifactId>
115+
<version>${project.version}</version>
116+
<type>test-jar</type>
117+
<scope>test</scope>
118+
</dependency>
119+
</dependencies>
120+
121+
<profiles>
122+
<profile>
123+
<id>full</id>
124+
<activation>
125+
<property>
126+
<name>!quickly</name>
127+
</property>
128+
</activation>
129+
<build>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.apache.maven.plugins</groupId>
133+
<artifactId>maven-failsafe-plugin</artifactId>
134+
<executions>
135+
<execution>
136+
<id>integration-test</id>
137+
<goals>
138+
<goal>integration-test</goal>
139+
<goal>verify</goal>
140+
</goals>
141+
</execution>
142+
</executions>
143+
</plugin>
144+
</plugins>
145+
</build>
146+
</profile>
147+
</profiles>
148+
149+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/* Generated by camel build tools - do NOT edit this file! */
2+
package org.apache.camel.component.file.remote.mina;
3+
4+
import javax.annotation.processing.Generated;
5+
import java.util.Map;
6+
7+
import org.apache.camel.CamelContext;
8+
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
9+
import org.apache.camel.spi.PropertyConfigurerGetter;
10+
import org.apache.camel.spi.ConfigurerStrategy;
11+
import org.apache.camel.spi.GeneratedPropertyConfigurer;
12+
import org.apache.camel.util.CaseInsensitiveMap;
13+
import org.apache.camel.support.component.PropertyConfigurerSupport;
14+
15+
/**
16+
* Generated by camel build tools - do NOT edit this file!
17+
*/
18+
@Generated("org.apache.camel.maven.packaging.EndpointSchemaGeneratorMojo")
19+
@SuppressWarnings("unchecked")
20+
public class MinaSftpComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
21+
22+
@Override
23+
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
24+
MinaSftpComponent target = (MinaSftpComponent) obj;
25+
switch (ignoreCase ? name.toLowerCase() : name) {
26+
case "autowiredenabled":
27+
case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
28+
case "bridgeerrorhandler":
29+
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
30+
case "healthcheckconsumerenabled":
31+
case "healthCheckConsumerEnabled": target.setHealthCheckConsumerEnabled(property(camelContext, boolean.class, value)); return true;
32+
case "healthcheckproducerenabled":
33+
case "healthCheckProducerEnabled": target.setHealthCheckProducerEnabled(property(camelContext, boolean.class, value)); return true;
34+
case "lazystartproducer":
35+
case "lazyStartProducer": target.setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
36+
default: return false;
37+
}
38+
}
39+
40+
@Override
41+
public Class<?> getOptionType(String name, boolean ignoreCase) {
42+
switch (ignoreCase ? name.toLowerCase() : name) {
43+
case "autowiredenabled":
44+
case "autowiredEnabled": return boolean.class;
45+
case "bridgeerrorhandler":
46+
case "bridgeErrorHandler": return boolean.class;
47+
case "healthcheckconsumerenabled":
48+
case "healthCheckConsumerEnabled": return boolean.class;
49+
case "healthcheckproducerenabled":
50+
case "healthCheckProducerEnabled": return boolean.class;
51+
case "lazystartproducer":
52+
case "lazyStartProducer": return boolean.class;
53+
default: return null;
54+
}
55+
}
56+
57+
@Override
58+
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
59+
MinaSftpComponent target = (MinaSftpComponent) obj;
60+
switch (ignoreCase ? name.toLowerCase() : name) {
61+
case "autowiredenabled":
62+
case "autowiredEnabled": return target.isAutowiredEnabled();
63+
case "bridgeerrorhandler":
64+
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
65+
case "healthcheckconsumerenabled":
66+
case "healthCheckConsumerEnabled": return target.isHealthCheckConsumerEnabled();
67+
case "healthcheckproducerenabled":
68+
case "healthCheckProducerEnabled": return target.isHealthCheckProducerEnabled();
69+
case "lazystartproducer":
70+
case "lazyStartProducer": return target.isLazyStartProducer();
71+
default: return null;
72+
}
73+
}
74+
}
75+

0 commit comments

Comments
 (0)