在 ftp 上移动文件 [英] Move files on ftp
问题描述
我正在使用 Apache Camel Spring 框架.我有一个组件 FTP(从 ftp 获取文件)和 Bean(处理文件并将其存储在数据库中).我所缺少的只是当我处理这些文件并将其存储在数据库中时,我必须检查插入或更新是否成功(这也有效).如果操作成功,我必须将文件移动到 ftp 上的另一个文件夹,如果操作不成功,我必须将其移动到 ftp 上的另一个文件夹.
I am working with Apache Camel Spring Framework. I have a component FTP (to get files from ftp) and Bean (process files and store it in database). All I have missing is when I process those files and store it in database I have to check if insert or update was successful (this is working too). If the action is successful I have to move the file to another folder on ftp, if it is unsuccessful I have to move it to a different folder on ftp.
所以我问是否有一种简单的方法可以将文件从位置 dirA 复制到 dirB
So I am asking if there is a simple way to copy the file from location dirA to dirB
推荐答案
你需要知道的一切都在这里 Apache Camel:文件 2搜索 move
和 moveFailed
.
Everything you need to know is here Apache Camel: File2
Search for move
and moveFailed
.
如果插入不成功,你可能会抛出一个 骆驼异常.然后 Camel 会将文件移动到您指定的文件夹中.
If insert was not successful you may throw a CamelException. Camel will then move the file to the folder you specified.
ftp://10.10.10.10/toRead?move=inDB&moveFailed=notInDB
这篇关于在 ftp 上移动文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!