mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
优化Ftp.download,返回false抛出异常(issue#3805@Github)
This commit is contained in:
@@ -708,9 +708,11 @@ public class Ftp extends AbstractFtp {
|
||||
if (null != fileNameCharset) {
|
||||
fileName = new String(fileName.getBytes(fileNameCharset), StandardCharsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
boolean isSuccess;
|
||||
try {
|
||||
client.setFileType(FTPClient.BINARY_FILE_TYPE);
|
||||
client.retrieveFile(fileName, out);
|
||||
isSuccess = client.retrieveFile(fileName, out);
|
||||
} catch (IOException e) {
|
||||
throw new IORuntimeException(e);
|
||||
} finally {
|
||||
@@ -718,6 +720,10 @@ public class Ftp extends AbstractFtp {
|
||||
cd(pwd);
|
||||
}
|
||||
}
|
||||
|
||||
if(false == isSuccess){
|
||||
throw new FtpException("retrieveFile return false");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user