From c0acf598e44d3ac2fced4061764d1a01e40a2d62 Mon Sep 17 00:00:00 2001 From: LiJun <LiJun@192.168.10.20> Date: 星期二, 27 十一月 2018 09:56:55 +0800 Subject: [PATCH] 跨域访问请求中的允许跨域访问代码注释,在过滤器中开启跨域允许接口 --- gx_tieta/src/com/fgkj/actions/ActionUtil.java | 38 +++++++++++++++++++++++++++++++++++++- 1 files changed, 37 insertions(+), 1 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/ActionUtil.java b/gx_tieta/src/com/fgkj/actions/ActionUtil.java index 86367a7..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; @@ -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