2017-07-28 9 views
0

SFTPサーバーの場所からファイルをダウンロードしようとしていますが、最終的にログは見えません。サーバーからlocal.Noエラーも来ません。利用可能Apache Camel SFTPのダウンロードがうまくいかない

SFTPファイル:

[[email protected] test1]# ls /tmp/files/test1 
test1.txt test2.txt test3.txt test4.txt 

ルータ:

@Component 
public class SampleCamelRouter extends RouteBuilder { 

    @Override 
    public void configure() throws Exception { 
     getContext().getShutdownStrategy().setTimeout(10); 

     from("sftp://[email protected]/tmp/files/test1?password=pass") 
       .to("file:C:/out") 
       .log("Downloaded file ${file:name} complete."); 
    } 

} 

ログイン:

o.a.camel.spring.SpringCamelContext  : Route: route1 started and consuming from: sftp://[email protected]/tmp/files/test1/test1.txt?password=xxxxxx 
o.a.camel.spring.SpringCamelContext  : Total 1 routes, of which 1 are 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 for 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> 
+0

Windows版?あなたは他のファイルを試しましたか? 'C:/ Test/out'? – Azeem

+0

返信いただき、ありがとうございました。 – sunleo

+0

はい。アクセス許可に問題があることがあります。あなたが使用したパスに 'C:\ out'というファイルがあるかどうか確認しましたか?もう一度試してみて、もう一度試してみてください。 – Azeem

答えて

0

ファイルが正常にサーバーからダウンロードされていますが、ダウンロードすることができないファイルのないように、場所が異なっています。

Location from download :[email protected]/tmp/uta/test1 
Location from downloaded:[email protected]/home/user/tmp/uta/test1 

ユーザーのホームディレクトリ内にアップロードディレクトリが作成されているため、予想されるディレクトリでは利用できません。

関連する問題