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"
© . This site is unofficial and not affiliated with VMware.