From 0b07256c9bcefb1d72ad03a053cef54ab1ca9cdc Mon Sep 17 00:00:00 2001 From: seven332 Date: Sat, 20 Dec 2014 03:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8D=20EBUSY=20(Device=20or=20res?= =?UTF-8?q?ource=20busy)=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/hippo/ehviewer/util/Utils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/com/hippo/ehviewer/util/Utils.java b/src/com/hippo/ehviewer/util/Utils.java index 6787204a0..0bc760742 100644 --- a/src/com/hippo/ehviewer/util/Utils.java +++ b/src/com/hippo/ehviewer/util/Utils.java @@ -209,7 +209,12 @@ public final class Utils { for (File f : files) deleteFile(f); } - file.delete(); + final File to = new File(file.getAbsolutePath() + + System.currentTimeMillis()); + if (file.renameTo(to)) + to.delete(); + else + file.delete(); } /**