FTP/FTPS 适配器
Spring Integration 提供了對使用 FTP 和 FTPS 進行檔案傳輸操作的支援。
檔案傳輸協定 (FTP) 是一種簡單的網路協定,可讓您在網際網路上兩部電腦之間傳輸檔案。FTPS 代表 “FTP over SSL”。
您需要將此相依性包含到您的專案中
-
Maven
-
Gradle
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ftp</artifactId>
<version>6.3.5</version>
</dependency>
compile "org.springframework.integration:spring-integration-ftp:6.3.5"
當談到 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"