|
如需使用最新稳定版本,请使用 Spring Integration 7.0.4! |
FTP/FTPS 调用器
Spring Integration 提供了对通过 FTP 和 FTPS 进行文件传输操作的支持。
文件传输协议(FTP)是一种简单的网络协议,允许您在互联网上的两台计算机之间传输文件。 FTPS 代表“基于 SSL 的 FTP”。
您需要将以下依赖项包含到您的项目中:
-
Maven
-
Gradle
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ftp</artifactId>
<version>6.4.10</version>
</dependency>
compile "org.springframework.integration:spring-integration-ftp:6.4.10"
在 FTP 通信中涉及两个角色:客户端和服务器。 要使用 FTP 或 FTPS 传输文件,您需要一个客户端来发起与运行 FTP 服务器的远程计算机的连接。 连接建立后,客户端可以选择发送或接收文件的副本。
Spring Integration 支持通过提供三个客户端端点:入站通道适配器、出站通道适配器和出站网关,来发送和接收通过 FTP 或 FTPS 的文件。 它还提供了基于命名空间的便捷配置选项,用于定义这些客户端组件。
要使用 FTP 命名空间,请在 XML 文件的头部添加以下内容:
xmlns:int-ftp="http://www.springframework.org/schema/integration/ftp"
xsi:schemaLocation="http://www.springframework.org/schema/integration/ftp
https://www.springframework.org/schema/integration/ftp/spring-integration-ftp.xsd"