[英]How to get zip files from sftp server using spring
I'm working on a project where I have a lot of zip files in an sftp server. 我正在开发一个项目,我在sftp服务器上有很多zip文件。 What I want to do is to connect to this sftp server and for each zip file if it exists, transfer it locally decompress it and make my process.
我想要做的是连接到这个sftp服务器和每个zip文件(如果存在),在本地传输解压缩它并进行我的处理。
I managed to create my decompress class and set up the spring configuration for my project. 我设法创建了我的解压缩类并为我的项目设置了弹簧配置。 I began to look for a tutorial and I found the sample integration spring example but I didn't understand two things.
我开始寻找一个教程,我找到了示例集成spring示例,但我不明白两件事。 How can I get the information that my connection is established and how to know that there's some zip files in this server?
如何获取建立连接的信息以及如何知道此服务器中有一些zip文件? If someone can explain me how to do this with an example it'll be great.
如果有人可以通过一个例子向我解释如何做到这一点,那就太好了。
You can do it by using Spring Integration
framework. 您可以使用
Spring Integration
框架来完成。 It has it's own SFTP Adapter
. 它有自己的
SFTP Adapter
。 Just initialize the SFTP Session Factory
and create the session object. 只需初始化
SFTP Session Factory
并创建会话对象。
More is here: http://docs.spring.io/spring-integration/reference/html/sftp.html 更多内容在这里: http : //docs.spring.io/spring-integration/reference/html/sftp.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.