久久久久久久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(使用線程逐塊處理文件)
主站蜘蛛池模板: 国产精品久久亚洲7777 | 九色在线视频 | 喷水毛片 | 999精品在线| 亚洲精品久久久久久一区二区 | 性一交一乱一透一a级 | 在线成人精品视频 | 久久88| 国产中文 | 亚洲色图婷婷 | 久久久久国产一区二区 | 日本一区二区三区四区 | 在线观看视频91 | 久久久久久久久久久久久久久久久久久久 | 国产伊人精品 | 国产伦精品一区二区三区高清 | 国产毛片久久久 | 视频在线亚洲 | 中文字幕一区二区三区乱码图片 | 国产日韩欧美在线 | 亚洲精品久久久久久久久久吃药 | 午夜在线视频一区二区三区 | 亚洲欧美日韩一区二区 | 免费观看一级特黄欧美大片 | 一级大片免费 | 午夜影院在线观看 | 久久久精品网站 | 婷婷精品 | 特一级毛片| 中文在线a在线 | 高清久久久 | 91性高湖久久久久久久久_久久99 | 欧美日韩一区二区在线播放 | 日韩成人久久 | 男女羞羞视频在线免费观看 | 久久精品免费一区二区三 | 99热激情 | 国产精品久久久久国产a级 欧美日韩国产免费 | 日韩欧美国产成人一区二区 | 国产精品极品美女在线观看免费 | 久草视频观看 |