久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

有沒有辦法在 Java Web 程序中判斷 FTP 服務器是主

Is there a way to tell if the FTP server is active or passive in the Java web program?(有沒有辦法在 Java Web 程序中判斷 FTP 服務器是主動的還是被動的?)
本文介紹了有沒有辦法在 Java Web 程序中判斷 FTP 服務器是主動的還是被動的?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在使用 Apache-Commons-Net 庫.

I'm using the Apache-Commons-Net library.

我想知道 FTP 服務器是主動模式還是被動模式.

I want to know if the FTP server is active-mode or passive-mode.

Apache-Commons-Net 庫中有這樣的方法嗎?

Is there a method like that in the Apache-Commons-Net library?

(GetDataConnectionMode()是Java中連接后告訴你連接模式的方法.我想在之前檢查Maud)

(GetDataConnectionMode() is a method that tells you the connected mode after connecting in Java. I want to check Maud before)

private FTPClient ftp;

// the code I want
if(active){
  ftp.enterLocalActiveMode();
}else{
  ftp.enterLocalPassiveMode();
}

// Apply active mode or passive mode to the environment of the server for oneself

推薦答案

正如@Erwin 已經評論的那樣,服務器不是處于主動或被動模式.服務器通常同時支持這兩種模式.

As @Erwin already commented, servers are not in active or passive mode. Servers usually support both modes at the same time.

您需要使用的模式,通常取決于您和服務器之間的網絡配置,而不是服務器上的某個開關".幾乎沒有任何方法可以檢測到這一點.

A mode that you need to use, typically depends on a configuration of the network between you and the server, not on some "switch" on the server. There's hardly any way to detect that.

您所能做的就是嘗試一種模式并在第一種模式失敗時回退到另一種模式.一般來說,您應該從被動模式開始,因為這往往更有效.

All you can do is to try one mode and fallback to the other if the first mode fails. In general, you should start with the passive mode, as that tends to work more often.

另請閱讀我關于 FTP 連接模式的文章以及它們所需的網絡配置,以明白,這是關于什么的.

Read also my article on FTP connection modes and the network configuration needed for them, to understand, what this is about.

這篇關于有沒有辦法在 Java Web 程序中判斷 FTP 服務器是主動的還是被動的?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 精品国产一区二区三区久久久四川 | 最新中文字幕久久 | 日韩一区精品 | 欧美一区二区三区在线观看 | 亚洲精品天堂 | 黄色激情毛片 | 99精品欧美一区二区蜜桃免费 | 成人午夜激情 | 国产一区二区在线播放 | 国产视频精品在线 | 欧美精品一区三区 | 粉嫩av在线 | 色综合久 | 欧美精品一区二区三区在线 | 欧美综合久久久 | 亚洲欧美日韩精品久久亚洲区 | 亚洲午夜在线 | 99久久精品一区二区毛片吞精 | 欧美日本在线观看 | 国产精品视频一区二区三区, | 亚洲一区二区三区免费视频 | 成人区精品 | 一区二区三区四区国产 | 9999精品视频 | 爱爱爱av| 国产精品一二区 | 日韩激情免费 | 日韩毛片免费视频 | 成人依人 | 欧美综合国产精品久久丁香 | www国产成人免费观看视频,深夜成人网 | 精品国产一区二区三区久久影院 | 国产精品日本一区二区不卡视频 | 日韩高清国产一区在线 | 亚洲电影一区二区三区 | 午夜视频免费在线观看 | 国产精品久久久久久久久久 | 野狼在线社区2017入口 | 亚洲色图综合 | 日本精品久久久久久久 | 精品国产欧美一区二区 |