【问题标题】:How to FTP in Java如何在 Java 中进行 FTP
【发布时间】:2012-11-21 05:35:22
【问题描述】:

我正在尝试通过 FTPS 下载文件,结果文件始终为空。 (我使用的是 org.apache.commons.net.ftp.FTPClient)

FTPSClient client = new FTPSClient( );
OutputStream outStream;

client.connect("ip");
client.login("user", "pass");

String remoteFile = "filePath";
outStream = new FileOutputStream( "destinationFile" );
client.retrieveFile(remoteFile, outStream);
outStream.flush();

【问题讨论】:

  • 也许你应该关闭外流?...

标签: java apache ftp java-io


【解决方案1】:

JSch Java 库是解决您问题的好选择

【讨论】:

  • 我给了你+1,但别人给了你-1……我怎么能接受?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2011-08-18
  • 1970-01-01
  • 1970-01-01
  • 2013-02-24
  • 1970-01-01
  • 2023-03-24
  • 1970-01-01
相关资源
最近更新 更多