From d7da61c394589157bc4ede3c4730d2ebb9d8ab2b Mon Sep 17 00:00:00 2001
From: chenlw <874313221@qq.com>
Date: Thu, 8 Sep 2016 11:26:14 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E7=BC=96=E7=A0=81=E6=96=B9=E5=BC=8Fut?=
=?UTF-8?q?f8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.classpath | 6 +-
WebContent/WEB-INF/config/config.properties | 2 +-
build/classes/.gitignore | 4 +-
.../controller/DataModelController.class | Bin 5314 -> 5307 bytes
.../controller/DefaultController.class | Bin 1651 -> 1342 bytes
.../platform/entities/EncodedInfoEntity.class | Bin 1136 -> 1136 bytes
.../classes/com/platform/utils/Configs.class | Bin 1676 -> 1784 bytes
src/com/base/BaseController.java | 53 +--
src/com/base/Constant.java | 28 +-
src/com/base/Custom4exception.java | 45 +-
src/com/base/CustomException.java | 53 +--
src/com/base/FileOperate.java | 383 ------------------
src/com/base/Resource.java | 20 +-
src/com/base/WritefileThread.java | 68 ----
.../controller/DataModelController.java | 9 +-
.../controller/DefaultController.java | 15 +-
.../platform/controller/FolderController.java | 35 ++
src/com/platform/dao/EncodeInfoDao.java | 42 +-
src/com/platform/entities/DataInfoEntity.java | 30 +-
.../platform/entities/EncodedInfoEntity.java | 10 +-
src/com/platform/entities/PagerOptions.java | 24 +-
src/com/platform/oracle/OracleConnector.java | 6 +-
.../platform/service/DataInfoServiceImp.java | 8 +-
.../platform/service/EncodeInfoService.java | 2 +-
.../service/EncodeInfoServiceImpl.java | 6 +-
.../platform/service/OracleExtractHelper.java | 22 +-
.../platform/service/OracleStatusService.java | 22 +-
src/com/platform/utils/ConfigLoder.java | 2 +-
.../platform/utils/ConfigPropertyReader.java | 2 +-
src/com/platform/utils/Configs.java | 35 +-
src/com/platform/utils/ConfigsLoader.java | 4 +-
src/com/platform/utils/FileOperateHelper.java | 8 +-
src/com/platform/utils/UtilsHelper.java | 8 +-
test/com/platform/test/TestController.java | 4 +-
test/com/platform/test/TestEncodeInfoDao.java | 8 +-
test/com/platform/test/TestEncodeService.java | 4 +-
test/com/test/base/ResourceTest.java | 23 --
37 files changed, 260 insertions(+), 731 deletions(-)
delete mode 100644 src/com/base/FileOperate.java
delete mode 100644 src/com/base/WritefileThread.java
create mode 100644 src/com/platform/controller/FolderController.java
delete mode 100644 test/com/test/base/ResourceTest.java
diff --git a/.classpath b/.classpath
index 7155d58e..b39d1be2 100644
--- a/.classpath
+++ b/.classpath
@@ -4,15 +4,11 @@
-
-
-
-
-
+
diff --git a/WebContent/WEB-INF/config/config.properties b/WebContent/WEB-INF/config/config.properties
index 56b7bdea..6f9d7280 100644
--- a/WebContent/WEB-INF/config/config.properties
+++ b/WebContent/WEB-INF/config/config.properties
@@ -4,7 +4,7 @@
# 驱动程序
jdbc.mysql.driver=com.mysql.jdbc.Driver
# 连接url
-jdbc.mysql.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
+jdbc.mysql.url=jdbc:mysql://192.168.0.101:3306/test?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true
# 用户名
jdbc.mysql.username=root
# 密码
diff --git a/build/classes/.gitignore b/build/classes/.gitignore
index 67f303f0..4bc3afa4 100644
--- a/build/classes/.gitignore
+++ b/build/classes/.gitignore
@@ -1,2 +1,2 @@
-/com/
-/dataSystem.properties
+/com
+/spring-applicationContext-test.xml
diff --git a/build/classes/com/platform/controller/DataModelController.class b/build/classes/com/platform/controller/DataModelController.class
index 6d59835f007275654e707e8692e2fa22d4157103..837dcfdebf39365d3eb889b3609a1f628200473b 100644
GIT binary patch
delta 227
zcmX@4xm$CBgP=fGVp*boPGVlVzJF3yYI4cOh-zL&iOE-ZZCPa*SQ+Fti}9&5x~ed+
zGpI7~GpI30FsK7b4F)>~O$J{EErw7AZH7b!9fk@9U507~J%&j@xj77m467N87&Zgx
zZ44$1dl`%w4l$T*ZsLz%z(ZLlpolY2#DzhU!4+tP8<2Eo
z2n3SR44#{x3Ys%2`T>>r1C<0YC<7%l7=nP>gBe1AFbT-cVF;gWD}0+VcCw^M25TY%
L2Sd{2HW3>D7E&z%
delta 234
zcmdn3c}R1DgM@f;ey)B}VsWaz6OeGu&nqd)&&f$G+89{P%P2YdEUzuA90MzZ{APYW
zbw*cJ26hHD27U&01_=fYAWM_MjzNpTmqD8$ltG6fkwKTCfRdqgAv1O
z24jZJKzbX4DZ^d{6NW0@DB{W>$>0Vw
z#vRD=U>byWKd=Z0=gg=XhaAQhB71p**Odmlg)&0GsaC8
R63JjqV&Gs%o?I_t0|2SCFWUeB
diff --git a/build/classes/com/platform/controller/DefaultController.class b/build/classes/com/platform/controller/DefaultController.class
index f975e29e332db9ea13d5969d0f8c27a806e0490f..9194050341ac120c7dd7616d178826116f726d0f 100644
GIT binary patch
delta 213
zcmey&vyY4G)W2Q(7#J9g8O$bfnFtDGC6*=X=OpH(>-#5Vr6!kb4ExQ*$EshFT3o`(
zpvPdq&Y(Ye8M8dIA%oH66U@4kTUojoc_$07#E@IWKWnvHjn#jk%$RG&B
zLeUJ2#SA(O>_9Oe1||k(AkDRjL1Yty?luOQjX)j~0~bgPNHZ`nJ}3J{eH
lJPf=*9!Oq|K^Xxl*a(27xl)UYnJDryClig3`7h!~Z4*sd?6Sa!+omKZPG
zy_xmG(UWI5NFovM{yQEu#u1Xr;mw=*zHer}%%T0WQ2g=d>mkr!(ITU$efU(XT9}Hn
zez@Vby;!?*5?W!9L}9n9qur%nnH78ft*I7@e6G-1obM*vzJf>NDmgm00(7|g(t`jFwPb*aErDAY7
z@%%TBz0IdyyQ|aB#(Pyv>*lNM5P62vkEXM2Fd@e?QR1d3*=fm2^2)2I7#B;h9WiOj
z?;J3>PkoP}JsMxAn6uR#$_F?v%D0s9jpjZx--RvT6LMD?3~Y(#kA_spQRR$OB}N$L
z0;61HWr9nb649084HOuZN_H{EW%2PZ8>dD_+A7S^lA#X-&7poXssx{xD#ODg_kywj
Fe*u!IZ*l+t
diff --git a/build/classes/com/platform/entities/EncodedInfoEntity.class b/build/classes/com/platform/entities/EncodedInfoEntity.class
index f920dc4d2cf3c57a9ef5aa9667a70937a4afebc9..ca2439bd9284f229bab46b209fc0d15f153bedfe 100644
GIT binary patch
delta 101
zcmeys@quGQ6B8rfm)@(M7pFbFbmG6*s7F$hn-#uUIP29~p7)?k%lU}cb=
voXPCQCm)@(MAqFbFenGKetnF^EpS#uUIP0hY62)?k%kU}cb<
voXPCQr~nkRWmN(4RVRO9PL$OIs%Bu|VPFK33Jm-V0zjIPK^sUiG3WpQPFWD}
diff --git a/build/classes/com/platform/utils/Configs.class b/build/classes/com/platform/utils/Configs.class
index 6bc46bf3d7a7fdae436c70e57756ebdeaada2dcb..ef6f24b0c30d29e1e22a23a0e34bcb7c6cf0f308 100644
GIT binary patch
delta 925
zcmYjP%Tg0T6g{1gkiE*@qEk|84+jn!U()^jOoGkcmAfD|~(8y09vnCZFXd_H9+;;C%XOb5_-
z^yQ~$zAaE+uy?DrRSaPOcj__dta`e}?hb64zNM3V`En
ziSF7tC5aogulEu?&P3g)|AWLXdY%2cg?uZu?Sr3o)YFJP2v8h47hj;b;aq%?VzQoc
zJJ@24iX(aO;!)F`>`7)ZJ-ZfII8mUE%)S$*5joige^iof^i2X&yMOl
zLBETLifJ^|h{pR$oZx|rN9wVQsj%<2i)l6EVop7A@l>VU1EkfGi)ALW>bZ*?k$9zE
zyI5CmTx_Z>7jJpl;pN>C9p-^WYnpx*ppn{9WI~uO-a@l)Bd6P`y-p0$z@jve5%PK*
zJ(whR27O4PpY{$SL%&!Kxd_$}!zK)rb!pIz$p6#(MF{zZzJX)dXJ_+Bh}2u;>Gwxe
Lh!d#lGJF33KO}566g^D_GIWGAV!(+(z!1=vfkeasR74R36;x0GLySrAg=ZyhSY>VLCiT7~
z)e9*X?6gYV_$%&QS>D^>E&6nybNhCm)9-KOb0qZh-`67m892?*bW=y0>xtHnUm`s$
z&{=Ty>yBLvVFY8H7!`;)wUU*8pD&b)mhF_L_N-;6R4UdaE+X!J@0bfFBti%WFzI%A
zV&j)3B(IVJ!CJmzA1qYtVh{ppi3q~nc#8LC-BnK}ctzp_S6_8Md4?L-B)Z_|;u{j(
zhz2k#;IALlKNPFX-jY!82XKd2r;D~5Jp;)h{3ELj~n&%ZieY4`Z+R#l#oFRg)qo*7^E-^
zl6`|@*dUoSNX873EraC7b$ppd2Ld>c0lL*7@xKZAE32VHT+kR-69z9S%V0{0Lu52^
zYFc9^>ieT{UES1}Q@1td)q=)-^+02pxfS(D;|X)?>Y2uddZF=3ZEL*dVV8$Dtp**|
zfwwfS&>Mj+6Ch&|`d_+f>?3=FWNeh)YJy%QNlccqoT1ca>Du$8E@GJWj$jRA*gzax
tNMIL}D4EV6Lloz+J&TYH`VwDIX>mc^ob7M3W{*6czk^K$0#(yz|38bYZqon&
diff --git a/src/com/base/BaseController.java b/src/com/base/BaseController.java
index 8a6c02c2..2192dbc5 100644
--- a/src/com/base/BaseController.java
+++ b/src/com/base/BaseController.java
@@ -1,47 +1,54 @@
/**
- * ļ BaseController.java
- * Ȩ : XXƼ˾
- * : <>
- * ʱ䣺201697
- * ݣ<>
+ * 文件名 : BaseController.java
+ * 版权 : XX科技有限公司。
+ * 描述 : <描述>
+ * 修改时间:2016年9月7日
+ * 修改内容:<修改内容>
*/
package com.base;
import javax.servlet.http.HttpServletRequest;
+import org.apache.log4j.Logger;
import org.springframework.web.bind.annotation.ExceptionHandler;
+import com.platform.utils.Configs;
+
/**
- * <һ仰ܼ>
- * <ϸ>
+ * <一句话功能简述>
+ * <功能详细描述>
* @author chen
- * @version [汾ţ201697]
- * @see [/]
- * @since [Ʒ/ģ汾]
+ * @version [版本号,2016年9月7日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
*/
-public class BaseController {
+public class BaseController {
+
+ /** log4j */
+ public static Logger log = Logger.getRootLogger();
/**
- * <һ仰ܼ> @ExceptionHandler쳣----ȫ쳣
- * <ϸ>
+ * <一句话功能简述> 基于@ExceptionHandler异常处理----全局异常处理
+ * <功能详细描述>
* @param request
- * @param ex 쳣
+ * @param ex 异常
* @return
- * @see [ࡢ##Ա]
+ * @see [类、类#方法、类#成员]
*/
@ExceptionHandler
- public String exp(HttpServletRequest request, Exception ex) {
+ public Object exp(HttpServletRequest request, Exception ex) {
request.setAttribute("ex", ex);
System.err.println("BaseController --exp ");
- // ݲͬתͬҳ
- if(ex instanceof CustomException) {
- //TODO ·װjson
- System.err.println("BaseController --exp -- CustomException ");
- return "error-business";
+ // 根据不同错误转向不同页面
+ if(ex instanceof CustomException) {
+ CustomException cuse = (CustomException) ex;
+ log.error(Configs.GLOBAL_EXP_CUSTOM);
+ //TODO 从新封装json
+ return "{"+Configs.GLOBAL_EXP_CUSTOM+":"+cuse.getMsg()+"}";
} else {
- //TODO ָҳ
-
+ //TODO 其他错误则 调到指定页面
+ log.error(Configs.GLOBAL_EXP_NOT_CUSTOM, ex);
return "error";
}
}
diff --git a/src/com/base/Constant.java b/src/com/base/Constant.java
index 87bd657d..4d336465 100644
--- a/src/com/base/Constant.java
+++ b/src/com/base/Constant.java
@@ -1,32 +1,22 @@
package com.base;
-import java.io.File;
-
/**
- * @
- * @author chen
- * @date 2016830
- * @package com.base
+ * <一句话功能简述>
+ * <功能详细描述>
+ * @author chen
+ * @version [版本号,2016年9月8日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
*/
public class Constant {
- /** ļļ-dataSystem.properties */
- public static String SYSTEM_PROPERTIES_FIEL_PATH = "/com/base/dataSystem.properties";
-
- /** ʻļļ-i18n.properties */
+ /** 国际话配置文件文件-i18n.properties */
public static String I18N_PROPERTIES_FIEL_PATH = "/com/base/i18n.properties";
- /** ¼쳣ļ-system_exception.txt-λ-- */
- public final static String SYSTEM_EXCEPTION_FILEPATH = "\\log\\system_exception.txt";
-
-
- /** WritefileThread-߳˯ʱ--3000 */
+ /** WritefileThread-线程睡眠时间--3000 */
public final static long THREAD_SLEEP_WRITEFILETHREAD = 3000;
- /** Ƿ쳣дļ */
- public final static String IS_WRITE_LOGFILE = "iswritelogfile";
-
- /** CustomException¼쳣ĶĶ--10 */
+ /** CustomException记录报异常的对象的对象个数--10 */
public final static int CustomException_log_object_size = 10;
diff --git a/src/com/base/Custom4exception.java b/src/com/base/Custom4exception.java
index cfbab1e6..2aeba6c6 100644
--- a/src/com/base/Custom4exception.java
+++ b/src/com/base/Custom4exception.java
@@ -1,41 +1,20 @@
package com.base;
-
/**
- * @ 쳣
- * @author chen
- * @date 2016822
- * @package com.base
+ * <一句话功能简述> 异常常量编码
+ * <功能详细描述>
+ * @author chen
+ * @version [版本号,2016年9月8日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
*/
public class Custom4exception {
- //3003001001 : һλʶ쳣 ڶλʶģ飬λʶ𣬵ڰ˵ʮλʶ쳣
- /** 3쳣
- * 003ģ
- * 001Դ
- * 001쳣
+ //3003001001 : 第一位:标识异常, 第二到第四位:标识模块,第五道第七位:标识类别,第八道第十位标识具体异常
+ /**eg
+ * 3:异常
+ * 003:虚拟机模块
+ * 001:软件依赖虚拟机资源类别
+ * 001:启动异常
*/
- /** -Դ-VM쳣 */
- public final static String vbox_start_exp = "3003001001";
-
- /** -Դ-VBoxManage.exe 쳣 */
- public final static String vbox_exe_non_exist_exp = "3003001002";
-
- /** --ùļж쳣 */
- public final static String share_dir_interrupted_exp = "3003002001";
-
- /** ݹ-ϱ-жϻд쳣 */
- public final static String data_manage_interrupted_exp = "3004001001";
-
- /** ģutils-xml-xmlǷ쳣 */
- public final static String xml_field_Illega_exp = "3005001001";
-
- /** ģutils-xml-document쳣 */
- public final static String xml_docu_exp = "3005001002";
-
- /** ģutils-xml-д쳣 */
- public final static String xml_io_exp = "3005001003";
-
- /** ģutils-oracle-д쳣 */
- public final static String oracle_io_exp = "3005002001";
}
diff --git a/src/com/base/CustomException.java b/src/com/base/CustomException.java
index f9c4192c..1c1d43e9 100644
--- a/src/com/base/CustomException.java
+++ b/src/com/base/CustomException.java
@@ -1,35 +1,38 @@
package com.base;
+import org.apache.log4j.Logger;
+/**
+ * <一句话功能简述>
+ * <功能详细描述>
+ * @author chen
+ * @version [版本号,2016年9月8日]
+ * @see [相关类/方法]
+ * @since [产品/模块版本]
+ */
@SuppressWarnings("serial")
public class CustomException extends Exception {
-
- /** Զ쳣Ϣ-Ϣ */
+
+ /** log4j */
+ public static Logger log = Logger.getRootLogger();
+
+ /** 自定义异常信息-错误信息 */
private String msg;
- /** */
+ /** 操作对象 */
private Object[] objArray;
- /** 쳣 */
+ /** 异常 */
private Throwable cause;
- static{
- // Ƿ ¼ 쳣߳
- if (Boolean.valueOf(Resource.getProperties().get(Constant.IS_WRITE_LOGFILE))) {
- // ¼ 쳣߳
- WritefileThread wt = new WritefileThread();
- wt.start();
- }
- }
-
public CustomException() {
super();
}
/**
- * @ 쳣¼ļ
- * @param code 쳣
- * @param msg Զ쳣Ϣ
+ * @功能 将异常记录进文件
+ * @param code 异常编码
+ * @param msg 自定义异常信息
* @param e
* @param obj
*/
@@ -41,12 +44,12 @@ public class CustomException extends Exception {
sbuf.append(code);
sbuf.append("\r\n");
msg = Resource.getProperties().get(code);
- // ¼Զ 쳣
+ // 记录自定义的 异常
if (null != msg) {
sbuf.append(msg);
sbuf.append("\r\n");
}
- // ¼ԭʼ쳣
+ // 记录原始的异常
if (null != e) {
StackTraceElement[] array = e.getStackTrace();
cause = e.getCause();
@@ -55,7 +58,7 @@ public class CustomException extends Exception {
sbuf.append("\r\n");
}
}
- //¼ 쳣ʱ ǰĶ
+ //记录 出现异常时 当前的对象
if (null != obj) {
Object[] array = obj;
sbuf.append("Object[] size : ");
@@ -80,14 +83,12 @@ public class CustomException extends Exception {
}
sbuf.append("\r\n");
- // Ƿ д ļ
- if (Boolean.valueOf(Resource.getProperties().get(Constant.IS_WRITE_LOGFILE))) {
- WritefileThread.getStrArray().add(sbuf.toString());
- }
+ // 是否 写入 文件
+ log.error(sbuf.toString());
}
/**
- * @ msg
+ * @功能 获得msg
* @return msg
*/
public String getMsg() {
@@ -95,7 +96,7 @@ public class CustomException extends Exception {
}
/**
- * @ objArray
+ * @功能 获得objArray
* @return objArray
*/
public Object[] getObjArray() {
@@ -103,7 +104,7 @@ public class CustomException extends Exception {
}
/**
- * @ cause
+ * @功能 获得cause
* @return cause
*/
public Throwable getCause() {
diff --git a/src/com/base/FileOperate.java b/src/com/base/FileOperate.java
deleted file mode 100644
index 718d3d4d..00000000
--- a/src/com/base/FileOperate.java
+++ /dev/null
@@ -1,383 +0,0 @@
-package com.base;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.RandomAccessFile;
-import java.nio.channels.FileLock;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import javax.swing.filechooser.FileSystemView;
-
-/**
- * @ ļ
- * @author chen
- * @date 201688
- * @package com.utils
- */
-public class FileOperate {
- private final static String localDiskName = "ش";
- private final static String enlocalDiskName = "Local Disk";
- private final static String CD = "CD";
- private final static String DVD = "DVD";
- public static String usbPath = "";
-
- /**
- * @ ȡȫⲿƶӲ·
- *
- * @return
- */
- public static List filterDiskPath() {
- FileSystemView fileSystemView = FileSystemView.getFileSystemView();
- List diskPathName = new ArrayList();
- File[] roots = File.listRoots();
- for (File file : roots) {
- String diskName = fileSystemView.getSystemTypeDescription(file);// ȡ̵Ϣ
- if (diskName.startsWith(localDiskName) || diskName.startsWith(enlocalDiskName) || diskName.contains(CD)
- || diskName.contains(CD) || diskName.contains(DVD)) // Ϊƶʱ{
- continue;
- diskPathName.add(file.getAbsolutePath());
- }
- return diskPathName;
- }
-
- /**
- * @ ļ
- * @param path
- * ϼĿ¼
- * @param dirName
- * Ŀ¼
- * @return
- */
- public static int createDir(String path, String dirName) {
- File dirFile = new File(path + "\\" + dirName);
- if (!dirFile.exists()) {
- if (!dirFile.mkdirs()) {
- System.out.println("Ŀ¼ڣʧܣ");
- return 2;
- }
- return 1;
- }
- return 0;
- }
-
- /**
- * @ ļǷ
- *
- * @param path
- * ļ·
- * @return
- */
- public static boolean isFileExists(String path) {
- File file = new File(path);
- if (file.exists())
- return true;
- return false;
- }
-
- /**
- * @ ļǷ
- *
- * @param name
- * ļ·
- * @return
- */
- public static boolean file_dir_exist(String name) {
-
- try {
- File file = new File(name);
- if (!file.exists()) {
- return false;
- // return true;
- }
- }
- catch (Exception e) {
- // TODO: handle exception
- return false;
- }
- return true;
- }
-
- /**
- * @ 26ڵƴӵַʲôã
- * @param length
- * ƴӴ
- * @return
- */
- public static String getRandomString(int length) { // lengthʾַij
- String base = "abcdefghijklmnopqrstuvwxyz";
- Random random = new Random();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < length; i++) {
- int number = random.nextInt(base.length());
- sb.append(base.charAt(number));
- }
- return sb.toString();
- }
-
- /**
- * @ ַʽȡļ
- * @param fiel_name
- * ļ
- * @return ַ
- */
- public static String read_fileToStr(String fiel_name) {
- String str = "";
- try {
- File file = new File(fiel_name);
- String lineTxt = "";
- InputStreamReader read = new InputStreamReader(new FileInputStream(file), "gbk");// ǵʽ
- BufferedReader bufferedReader = new BufferedReader(read);
- while ((lineTxt = bufferedReader.readLine()) != null) {
- str = str + lineTxt;
- }
- bufferedReader.close();
- read.close();
- }
- catch (Exception e) {
- e.printStackTrace();
- return "Exception";
- }
- return str;
- }
-
- /**
- * @ ȡļ·ĸĿ¼ʽ
- * @param path_filename
- * ļļ·
- * @return
- */
- public static String get_filename_from_path(String path_filename) {
- String[] strings = path_filename.split("\\\\");
-
- return strings[strings.length - 1];
- }
-
- /**
- * @ dirPathĿ¼µļ
- * @param dirPath
- * Ŀ¼
- * @return ļ
- */
- public static List findAllFilenameFromPath(String dirPath) {
- ArrayList fileAbsolutePaths = new ArrayList<>();
- FileOperate.findFiles(dirPath, fileAbsolutePaths);
- return fileAbsolutePaths;
- }
-
- /**
- * @ ɾĿ¼ļļ
- * @param dirPath
- * Ŀ¼
- * @return
- */
- public static boolean delAllFileByDir(String dirPath) {
- boolean flag = false;
- File file = new File(dirPath);
- // жĿ¼ļǷ
- if (!file.exists()) { // ڷ false
- return flag;
- }
- else {
- // жǷΪļ
- if (file.isFile()) { // Ϊļʱɾļ
- return deleteFile(dirPath);
- }
- else { // ΪĿ¼ʱɾĿ¼
- return deleteDirectory(dirPath);
- }
- }
- }
-
- /**
- * @ дļ
- * @param content
- * ļ
- * @param filePathName
- * ļ·
- */
- public static void writeFile(List