java - Apache Camel SFTP download is not working -
i trying download file sftp server location log looks nothing downloaded server local.no errors coming.please give inputs in advance.
sftp files available:
[root@rsysftp test1]# ls /tmp/files/test1 test1.txt test2.txt test3.txt test4.txt
router:
@component public class samplecamelrouter extends routebuilder { @override public void configure() throws exception { getcontext().getshutdownstrategy().settimeout(10); from("sftp://ftpuser1@some.ip.value.here/tmp/files/test1?password=pass") .to("file:c:/out") .log("downloaded file ${file:name} complete."); } }
log:
o.a.camel.spring.springcamelcontext : route: route1 started , consuming from: sftp://ftpuser1@some.ip.value.here/tmp/files/test1/test1.txt?password=xxxxxx o.a.camel.spring.springcamelcontext : total 1 routes, of 1 started. o.a.camel.spring.springcamelcontext : apache camel 2.18.1 (camelcontext: samplecamel) started in 30.871 seconds s.b.c.e.t.tomcatembeddedservletcontainer : tomcat started on port(s): 8080 (http) c.camel.examples.samplecamelapplication : started samplecamelapplication in 37.837 seconds (jvm running 38.891)
pom.xml
<?xml version="1.0" encoding="utf-8"?> <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> <groupid>org.springframework</groupid> <artifactid>gs-spring-boot</artifactid> <version>0.1.0</version> <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.5.5.release</version> </parent> <dependencies> <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-web</artifactid> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-spring-boot-starter</artifactid> <version>2.18.1</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-stream-starter</artifactid> <version>2.18.1</version> </dependency> <dependency> <groupid>org.apache.camel</groupid> <artifactid>camel-ftp</artifactid> <version>2.18.1</version> </dependency> <dependency> <groupid>io.hawt</groupid> <artifactid>hawtio-springboot</artifactid> <version>2.0.0</version> </dependency> </dependencies> <properties> <java.version>1.8</java.version> </properties> <build> <plugins> <plugin> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-maven-plugin</artifactid> </plugin> </plugins> </build> </project>
file downloading server location different without files not able download.
location download :ftpuser1@some.ip.value.here/tmp/uta/test1 location downloaded:ftpuser1@some.ip.value.here/home/user/tmp/uta/test1
it creating uploading directory inside user home directory reason not available in expected directory.
Comments
Post a Comment