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 | 52 +++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/actions/ActionUtil.java b/gx_tieta/src/com/fgkj/actions/ActionUtil.java
index a68083d..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;
@@ -34,6 +35,8 @@
public static String time_yyyyMMddHHmmss = "yyyy-MM-dd HH:mm:ss";
+
+ public String key; //璺ㄥ煙璇嗗埆鐮�
/*
* 鑾峰彇HttpServletRequest
@@ -246,9 +249,6 @@
return new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss").format(c.getTime());
}
- public static void main(String[] args) {
- System.out.println(ActionUtil.EncryptionMD5("vip"));
- }
//鑾峰彇鏃堕棿鐨勫勾浠�
public static int getDateYear(Date date){
@@ -485,4 +485,50 @@
res.setHeader("Access-Control-Allow-Headers", "X-Requested-With,content-type,token");
res.setHeader("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH");
}
+
+
+
+ public void setKey(String key) {
+ 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)));
+
+
+ createFilefolderIFNotExist("d:/aaaa/aaaa/aaaa/aaaa/ddd.txt");
+ }
}
--
Gitblit v1.9.1