org.apache.commons.net.ftp中FTPClient类中的enterLocal ...()和enterRemote ...()方法之间的区别

时间:2019-05-19 11:53:11

标签: java ftp apache-commons-net

我试图找出org.apache中[enterLocalActiveMode()类的enterLocalPassiveMode() / enterRemoteActiveMode(InetAddress host, int port)enterRemotePassiveMode() / FTPClient方法之间的区别。 commons.net.ftp](https://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html )。

我仅找到有关FTP主动模式和被动模式之间差异的一些信息。但是我不理解前面提到的本地和远程的概念。

1 个答案:

答案 0 :(得分:1)

Apache Commons Net文档(您可以在问题中自行链接)对此进行了介绍。

在99%的情况下,您想使用FTPClient.enterLocal*Mode。这是用于客户端到服务器/服务器的转移

FTPClient.enterRemote*Mode仅用于服务器与服务器之间的传输(又称FXP)。大多数FTP服务器都不允许这么做。