| | |
| | | package com.fgkj.actions;
|
| | |
|
| | | import java.io.File;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.FileOutputStream;
|
| | | import java.io.IOException;
|
| | |
| | | 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");
|
| | | }
|
| | | }
|