mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
优化Ftp.download,返回false抛出异常(issue#3805@Github)
This commit is contained in:
parent
7da0856314
commit
0c5444e442
@ -6,6 +6,7 @@
|
||||
|
||||
### 🐣新特性
|
||||
* 【poi 】 优化ExcelWriter中使用比较器writer的方法,只对第一条数据进行排序(pr#3807@Github)
|
||||
* 【extra 】 优化Ftp.download,返回false抛出异常(issue#3805@Github)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【crypto 】 修复JWTSignerUtil.createSigner中algorithmId未转换问题(issue#3806@Github)
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user