From 305e57238bf6c790ed71ecb095a049778b3871dd Mon Sep 17 00:00:00 2001 From: "ran.shang" <> Date: Fri, 15 Aug 2025 14:56:08 +0800 Subject: [PATCH] fix file delete --- src/main/java/com/newyetai/component/file/util/FileUtils.java | 2 +- src/main/java/com/newyetai/sdk/xf/util/XfUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/newyetai/component/file/util/FileUtils.java b/src/main/java/com/newyetai/component/file/util/FileUtils.java index a275f4f..d223797 100644 --- a/src/main/java/com/newyetai/component/file/util/FileUtils.java +++ b/src/main/java/com/newyetai/component/file/util/FileUtils.java @@ -62,7 +62,7 @@ public class FileUtils { } public static FileInputStream copyToTempFile(InputStream in, File temp) throws IOException { - temp.deleteOnExit(); + temp.delete(); try (OutputStream out = new FileOutputStream(temp)) { byte[] buf = new byte[8192]; int len; diff --git a/src/main/java/com/newyetai/sdk/xf/util/XfUtils.java b/src/main/java/com/newyetai/sdk/xf/util/XfUtils.java index 0ad7a2d..801c3e1 100644 --- a/src/main/java/com/newyetai/sdk/xf/util/XfUtils.java +++ b/src/main/java/com/newyetai/sdk/xf/util/XfUtils.java @@ -115,7 +115,7 @@ public class XfUtils { } catch (Exception e) { throw e; } finally { - file.deleteOnExit(); + file.delete(); } } catch (Exception e) { throw new BusinessException("语音听写异常:" + e.getMessage()); @@ -275,7 +275,7 @@ public class XfUtils { } catch (Exception e) { throw e; } finally { - file.deleteOnExit(); + file.delete(); } }catch (Exception e) { throw new BusinessException("语音听写异常:" + e.getMessage());