From 512733908ae4f3a851f40f0551724d2186ce56ec Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.26>
Date: 星期四, 13 十二月 2018 11:20:11 +0800
Subject: [PATCH] Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw
---
gx_tieta/src/com/fgkj/actions/ActionUtil.java | 40 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/actions/ActionUtil.java b/gx_tieta/src/com/fgkj/actions/ActionUtil.java
index d3193d6..edb0b51 100644
--- a/gx_tieta/src/com/fgkj/actions/ActionUtil.java
+++ b/gx_tieta/src/com/fgkj/actions/ActionUtil.java
@@ -1,5 +1,6 @@
package com.fgkj.actions;
+import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -33,7 +34,7 @@
public class ActionUtil extends ActionSupport{
public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
- public final static String CROSS_DOMAIN_KEY = "44c4a294cb66d13727c14b065dbe8548"; //璺ㄥ煙璇锋眰 key
+
public String key; //璺ㄥ煙璇嗗埆鐮�
@@ -491,8 +492,43 @@
this.key = key;
}
+ /**
+ * 鍒涘缓鎸囧畾鐨勬枃浠舵枃浠讹紝鑻ヤ笉瀛樺湪鍒欏厛鍒涘缓鎸囧畾鐨勬枃浠跺す鍐嶅垱寤烘寚瀹氱殑鏂囦欢
+ * @param filePath
+ */
+ public static void createFileRootIFNotExist(String filePath){
+ File f = new File(filePath);
+ if(!f.exists()){
+ if(!f.getParentFile().exists()){
+ f.getParentFile().mkdirs();
+ }
+ try {
+ f.createNewFile();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * 鍒涘缓鎸囧畾鐨勬枃浠舵枃浠讹紝鑻ヤ笉瀛樺湪鍒欏厛鍒涘缓鎸囧畾鐨勬枃浠跺す鍐嶅垱寤烘寚瀹氱殑鏂囦欢
+ * @param filePath
+ */
+ public static void createFilefolderIFNotExist(String filePath){
+ File f = new File(filePath);
+ if(!f.exists()){
+ if(!f.getParentFile().exists()){
+ f.getParentFile().mkdirs();
+ }
+ }
+ }
+
+
public static void main(String[] args) {
String str = "绂忓厜鐢靛瓙";
- System.out.println(EncryptionMD5(EncryptionMD5(str)));
+ //System.out.println(EncryptionMD5(EncryptionMD5(str)));
+
+
+ createFilefolderIFNotExist("d:/aaaa/aaaa/aaaa/aaaa/ddd.txt");
}
}
--
Gitblit v1.9.1