81041
2019-01-11 fa00382db413a8489d07983b66f0869305b51a9a
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");
   }
}