我正在将大文件上传到FTP,并且已成功上传,但storeFile
方法中没有返回
核心代码:
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.enterLocalPassiveMode();
ftp.setControlEncoding("UTF-8");
ftp.setFileTransferMode(FTP.BINARY_FILE_TYPE);
if(!ftp.storeFile(filename, input))
{
return result;
}
堆栈信息:
"Thread-8731" #8873 prio=5 os_prio=0 tid=0x00007fed5034c000 nid=0x6489 runnable [0x00007fecb24f1000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
- locked <0x000000054d04d858> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.read(BufferedReader.java:182)
- locked <0x000000054d04d858> (a java.io.InputStreamReader)
at org.apache.commons.net.io.CRLFLineReader.readLine(CRLFLineReader.java:58)
- locked <0x000000054d04d858> (a java.io.InputStreamReader)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:314)
at org.apache.commons.net.ftp.FTP.__getReply(FTP.java:294)
at org.apache.commons.net.ftp.FTP.getReply(FTP.java:692)
at org.apache.commons.net.ftp.FTPClient.completePendingCommand(FTPClient.java:1813)
at org.apache.commons.net.ftp.FTPClient._storeFile(FTPClient.java:672)
at org.apache.commons.net.ftp.FTPClient.__storeFile(FTPClient.java:624)
at org.apache.commons.net.ftp.FTPClient.storeFile(FTPClient.java:1976)