此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Integration 6.3.1! |
此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Integration 6.3.1! |
Spring Integration 支持使用 FTP 和 FTPS 进行文件传输操作。
文件传输协议 (FTP) 是一种简单的网络协议,可用于在 Internet 上的两台计算机之间传输文件。 FTPS代表“基于SSL的FTP”。
您需要将此依赖项包含在项目中:
-
Maven
-
Gradle
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ftp</artifactId>
<version>6.3.2-SNAPSHOT</version>
</dependency>
compile "org.springframework.integration:spring-integration-ftp:6.3.2-SNAPSHOT"
在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"