From c2bb89da722d5b5db5f7151546369eb84b775a05 Mon Sep 17 00:00:00 2001
From: chenjiahe <763432473@qq.com>
Date: 星期一, 15 四月 2024 16:26:35 +0800
Subject: [PATCH] 线程池工具新增方法

---
 src/main/java/com/hx/util/FileConvertTool.java |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/hx/util/FileConvertTool.java b/src/main/java/com/hx/util/FileConvertTool.java
index 95359f6..da21ef8 100644
--- a/src/main/java/com/hx/util/FileConvertTool.java
+++ b/src/main/java/com/hx/util/FileConvertTool.java
@@ -112,7 +112,7 @@
             if(!dir.exists()){//鍒ゆ柇鏂囦欢鐩綍鏄惁瀛樺湪
                 dir.mkdirs();
             }
-            file = new File(filePath+"\\"+fileName);
+            file = new File(filePath+"/"+fileName);
             fos = new FileOutputStream(file);
             bos = new BufferedOutputStream(fos);
             bos.write(bfile);
@@ -263,6 +263,23 @@
     }
 
     /**
+     * 鍒犻櫎鍗曚釜鏂囦欢
+     * @param   file    琚垹闄ゆ枃浠�
+     * @return 鍗曚釜鏂囦欢鍒犻櫎鎴愬姛杩斿洖true锛屽惁鍒欒繑鍥瀎alse
+     */
+    public static boolean deleteFile(File file) {
+        if(file == null){
+            return true;
+        }
+        // 璺緞涓烘枃浠朵笖涓嶄负绌哄垯杩涜鍒犻櫎
+        if (file.isFile() && file.exists()) {
+            file.delete();
+            return true;
+        }
+        return false;
+    }
+
+    /**
      * 鍒犻櫎鐩綍锛堟枃浠跺す锛変互鍙婄洰褰曚笅鐨勬枃浠�
      * @param   sPath 琚垹闄ょ洰褰曠殑鏂囦欢璺緞
      * @return  鐩綍鍒犻櫎鎴愬姛杩斿洖true锛屽惁鍒欒繑鍥瀎alse

--
Gitblit v1.8.0