From b361614003a3a731f1cf7d9ccd1e010db84683a8 Mon Sep 17 00:00:00 2001 From: Looly Date: Wed, 4 Dec 2024 12:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Ftp.download=EF=BC=8C?= =?UTF-8?q?=E8=BF=94=E5=9B=9Efalse=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=88issue#3805@Github=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/dromara/hutool/extra/ftp/CommonsFtp.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/CommonsFtp.java b/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/CommonsFtp.java index f6cd904dc..81216f097 100644 --- a/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/CommonsFtp.java +++ b/hutool-extra/src/main/java/org/dromara/hutool/extra/ftp/CommonsFtp.java @@ -706,9 +706,9 @@ public class CommonsFtp extends AbstractFtp { * @param out 输出流,下载的文件写出到这个流中 * @param fileNameCharset 文件名编码,通过此编码转换文件名编码为ISO8859-1 * @throws IORuntimeException IO异常 - * @since 5.5.7 + * @return 是否下载成功 */ - public void download(final String path, String fileName, final OutputStream out, final Charset fileNameCharset) throws IORuntimeException { + public boolean download(final String path, String fileName, final OutputStream out, final Charset fileNameCharset) throws IORuntimeException { String pwd = null; if (this.backToPwd) { pwd = pwd(); @@ -723,7 +723,7 @@ public class CommonsFtp extends AbstractFtp { } try { client.setFileType(FTPClient.BINARY_FILE_TYPE); - client.retrieveFile(fileName, out); + return client.retrieveFile(fileName, out); } catch (final IOException e) { throw new IORuntimeException(e); } finally {