简体   繁体   English

如何使用spring从sftp服务器获取zip文件

[英]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.

相关问题 如何从 SFTP 服务器获取文件列表? - How to get list of files from an SFTP server? 使用 JSch 从 SFTP 服务器下载文件 - Downloading files from an SFTP server using JSch 如何在不使用 spring 引导的情况下使用 spring 集成从 sftp 服务器下载文件 - how to download file from sftp server using spring integration without using spring boot 使用 Spring 集成/JCraft JSch 在 SFTP 服务器上内部复制文件 - Copying files internally on an SFTP server using Spring integration/JCraft JSch 如何使用沙丁鱼从webdav服务器下载zip文件? - How to download zip files from webdav server using sardine? 当使用 Spring 引导 Java 启动 SFTP 远程服务器时如何获得通知? - How to get notified when SFTP Remote Server is UP using Spring Boot Java? SFTP使用Java从Windows服务器到Linux服务器检索文件 - SFTP to retrieve files from Windows server to Linux server using java 切换用户后如何使用JSch库获取SFTP服务器目录中所有文件的列表? - How to get list of all files within a directory on SFTP server using JSch library after switching a user? 使用 spring 集成从 SFTP 服务器读取 excel 文件的问题 - Issue in reading a excel file from SFTP server using spring integration Spring Integration Java DSL SFTP如何在处理程序中获取远程SFTP服务器信息 - Spring Integration Java DSL SFTP how to get remote SFTP server information in handler
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM