FTP/FTPS 适配器
Spring Integration 提供对 FTP 和 FTPS 文件传输操作的支持。
文件传输协议(FTP)是一种简单的网络协议,允许您在互联网上的两台计算机之间传输文件。FTPS 代表“基于 SSL 的 FTP”。
项目需要此依赖项
-
Maven
-
Gradle
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ftp</artifactId>
<version>7.0.0</version>
</dependency>
compile "org.springframework.integration:spring-integration-ftp:7.0.0"
在 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"