Problem with FTPClient class in java

后端 未结 2 613
再見小時候
再見小時候 2021-01-12 04:44

I\'m using org.apache.commons.net.ftp.FTPClient and seeing behavior that is, well... perplexing.

The method beneath intends to go through an FTPFile list, read them

2条回答
  •  萌比男神i
    2021-01-12 04:54

    According to the API for FTPClient.retrieveFileStream(), the method returns null when it cannot open the data connection, in which case you should check the reply code (e.g. getReplyCode(), getReplyString(), getReplyStrings()) to see why it failed. Also, you are suppose to finalize file transfers by calling completePendingCommand() and verifying that the transfer was indeed successful.

提交回复
热议问题