From 7c8b9e7b4a7853abddf54a373e6e7ecd49bff23b Mon Sep 17 00:00:00 2001 From: 3y Date: Wed, 15 Feb 2023 21:43:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=94=AF=E6=8C=81=20?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/java3y/austin/support/utils/AustinFileUtils.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/austin-support/src/main/java/com/java3y/austin/support/utils/AustinFileUtils.java b/austin-support/src/main/java/com/java3y/austin/support/utils/AustinFileUtils.java index 6d945de..b9a4dcf 100644 --- a/austin-support/src/main/java/com/java3y/austin/support/utils/AustinFileUtils.java +++ b/austin-support/src/main/java/com/java3y/austin/support/utils/AustinFileUtils.java @@ -24,10 +24,11 @@ public class AustinFileUtils { */ public static File getRemoteUrl2File(String path, String remoteUrl) { try { - new File(path).mkdirs(); URL url = new URL(remoteUrl); File file = new File(path, url.getPath()); - IoUtil.copy(url.openStream(), new FileOutputStream(file)); + if (!file.exists()) { + IoUtil.copy(url.openStream(), new FileOutputStream(file)); + } return file; } catch (Exception e) { log.error("AustinFileUtils#getRemoteUrl2File fail:{},remoteUrl:{}", Throwables.getStackTraceAsString(e), remoteUrl);