前进的FTP文件 [英] Move files on ftp

查看:133
本文介绍了前进的FTP文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与Apache的骆驼Spring框架的工作。我有一个部件的FTP(以获得从ftp的文件)和豆(流程文件并将其存储在数据库中)。所有我所缺少的是,当我处理这些文件,并将其存储在数据库中,我要检查,如果插入或更新成功(这是工作太)。如果操作成功,我必须将文件移动到另一个文件夹的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的骆驼:文件2
搜索移动 moveFailed

Everything you need to know is here Apache Camel: File2 Search for move and moveFailed.

如果插入不成功,你可能抛出的 CamelException 。然后将骆驼将文件移动到你指定的文件夹。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆