2017-11-14 1 views
0

apache camel endpoints 속성을 사용하여 FTP 서버에서 로컬 디렉토리로 파일을 이동하거나 다운로드 할 수 있는지 궁금합니다.apache camel endpoint를 사용하여 FTP 서버에서 로컬 디렉토리로 파일을 이동할 수 있습니까?

이 주제를 이미 검색 했으므로 도움이 될만한 자료를 찾을 수 없습니다. 또한, 나는 그 타당성을 확신하지 못합니다.

종점 URI =

sftp://[email protected]/outgoingFolder?password=*****&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0&stepwise=false&fastExistsCheck=true&disconnect=true&consumer.delay=300000&passiveMode=true

내가 사용 : 속성으로 "& 이동 = C \ 폴더를"하지만 그것은 작동하지 않았다 나는 다음과 같은 오류를 얻을

WARN - [SftpConsumer:213] Consumer Consumer[sftp://[email protected]/outgoingFolder?consumer.delay=300000&disconnect=true&fastExistsCheck=true&maximumReconnectAttempts=0&move=C%3A%5C%5Cfolders&passiveMode=true&password=xxxxxx&stepwise=false&throwExceptionOnConnectFailed=true] failed polling endpoint: Endpoint[sftp://[email protected]/outgoingFolder?consumer.delay=300000&disconnect=true&fastExistsCheck=true&maximumReconnectAttempts=0&move=C%3A%5C%5Cfolder&passiveMode=true&password=xxxxxx&stepwise=false&throwExceptionOnConnectFailed=true]. Will try again at next poll. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Cannot list directory:outgoingFolder]org.apache.camel.component.file.GenericFileOperationFailedException: Cannot list directory: outgoingFolder  at org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:617)  at org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:117)  at org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:79)  at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:131)  at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:175)  at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:102)  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)  at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  at java.lang.Thread.run(Thread.java:745)Caused by: 4:  at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2208)  at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2215)  at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1565)  at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1526)  at org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:608)  ... 12 more Caused by: java.io.IOException: inputstream is losed  at com.jcraft.jsch.ChannelSftp.fill(ChannelSftp.java:2884)  at com.jcraft.jsch.ChannelSftp.header(ChannelSftp.java:2908)  at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2189)  ... 16 more 

답변

1

아니요, & 이동 옵션은 원격 파일 시스템의 범위에서 파일을 이동하는 데 사용됩니다.

사용이 대신 :

from("sftp://[email protected]/outgoingFolder?password=*****&throwExceptionOnConnectFailed=true&maximumReconnectAttempts=0&stepwise=false&fastExistsCheck=true&disconnect=true&consumer.delay=300000&passiveMode=true") 
.to("file:C:\\folder"); 
관련 문제