Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
216 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* 修改时间:2016年11月6日 | ||
* 修改内容:新增 | ||
*/ | ||
package utils; | ||
package com.zxiaofan.util.other; | ||
|
||
/** | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/passwordUtil/AESUtil.java → src/com/zxiaofan/util/password/AESUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* 文件名:Check.java | ||
* 版权:Copyright 2007-2017 zxiaofan.com. Co. Ltd. All Rights Reserved. | ||
* 描述: Check.java | ||
* 修改人:zxiaofan | ||
* 修改时间:2017年4月7日 | ||
* 修改内容:新增 | ||
*/ | ||
package com.zxiaofan.util.password; | ||
|
||
/** | ||
* 校验器,支持生成字典数据时立即校验. | ||
* | ||
* @author xiaofan | ||
* | ||
*/ | ||
public class Check { | ||
int minLen = 1; // 执行execute参数param最小位数 | ||
|
||
int maxLen = Integer.MAX_VALUE; | ||
|
||
/** | ||
* 构造函数. | ||
* | ||
* @param minLen | ||
* 最少位数 | ||
* @param maxLen | ||
* 最多位数 | ||
*/ | ||
public Check(int minLen, int maxLen) { | ||
super(); | ||
this.minLen = minLen; | ||
this.maxLen = maxLen; | ||
} | ||
|
||
/** | ||
* 校验. | ||
* | ||
* @param param | ||
* 参数 | ||
* @return 校验结果 | ||
*/ | ||
protected boolean execute(String param) { | ||
return false; | ||
}; | ||
} |
2 changes: 1 addition & 1 deletion
2
src/passwordUtil/DESUtil.java → src/com/zxiaofan/util/password/DESUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/passwordUtil/MD5.java → src/com/zxiaofan/util/password/MD5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/privateUtil/DataExtractUtil.java → ...fan/util/privateUtil/DataExtractUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* @author zxiaofan | ||
* | ||
*/ | ||
package privateUtil; | ||
package com.zxiaofan.util.privateUtil; | ||
/** | ||
* 私有工具类 | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
/* | ||
* 文件名:FileUtil.java | ||
* 版权:Copyright 2007-2016 zxiaofan.com. Co. Ltd. All Rights Reserved. | ||
* 描述: FileUtil.java | ||
* 修改人:zxiaofan | ||
* 修改时间:2017年04月07日 | ||
* 修改内容:新增 | ||
*/ | ||
package com.zxiaofan.util.rpc; | ||
|
||
import org.apache.http.HttpResponse; | ||
import org.apache.http.client.HttpClient; | ||
import org.apache.http.client.config.RequestConfig; | ||
import org.apache.http.client.methods.HttpGet; | ||
import org.apache.http.client.methods.HttpPost; | ||
import org.apache.http.util.EntityUtils; | ||
|
||
/** | ||
* HttpClient的Http工具类. | ||
* | ||
* @author yunhai | ||
*/ | ||
public class HttpClientUtil { | ||
/** | ||
* 默认超时时间. | ||
*/ | ||
public static int timeoutDefault = 60000; | ||
|
||
/** | ||
* 请求参数配置. | ||
*/ | ||
private static RequestConfig requestConfigDefault = null; | ||
|
||
/** | ||
* HttpClient-post(默认超时时间timeoutDefault). | ||
* | ||
* @param httpClient | ||
* httpClient | ||
* @param httpPost | ||
* httpPost | ||
* @return result | ||
* @throws Exception | ||
* Exception | ||
*/ | ||
public static String execute(HttpClient httpClient, HttpPost httpPost) throws Exception { | ||
httpPost.setConfig(getDefaultRequestConfig()); | ||
HttpResponse execute = httpClient.execute(httpPost); | ||
String result = EntityUtils.toString(execute.getEntity(), "UTF-8"); | ||
return result; | ||
} | ||
|
||
/** | ||
* HttpClient-post. | ||
* | ||
* @param httpClient | ||
* httpClient | ||
* @param httpPost | ||
* httpPost | ||
* @param requestConfig | ||
* requestConfig | ||
* @return result | ||
* @throws Exception | ||
* Exception | ||
*/ | ||
public static String execute(HttpClient httpClient, HttpPost httpPost, RequestConfig requestConfig) throws Exception { | ||
httpPost.setConfig(requestConfig); | ||
HttpResponse execute = httpClient.execute(httpPost); | ||
String result = EntityUtils.toString(execute.getEntity(), "UTF-8"); | ||
return result; | ||
} | ||
|
||
/** | ||
* HttpClient-Get(默认超时时间timeoutDefault). | ||
* | ||
* @param httpClient | ||
* httpClient | ||
* @param httpGet | ||
* httpGet | ||
* @return String | ||
* @throws Exception | ||
* Exception | ||
*/ | ||
public static String execute(HttpClient httpClient, HttpGet httpGet) throws Exception { | ||
httpGet.setConfig(getDefaultRequestConfig()); | ||
HttpResponse execute = httpClient.execute(httpGet); | ||
String result = EntityUtils.toString(execute.getEntity(), "UTF-8"); | ||
return result; | ||
} | ||
|
||
/** | ||
* HttpClient-Get. | ||
* | ||
* @param httpClient | ||
* httpClient | ||
* @param httpGet | ||
* httpGet | ||
* @param requestConfig | ||
* requestConfig | ||
* @return String | ||
* @throws Exception | ||
* Exception | ||
*/ | ||
public static String execute(HttpClient httpClient, HttpGet httpGet, RequestConfig requestConfig) throws Exception { | ||
httpGet.setConfig(requestConfig); | ||
HttpResponse execute = httpClient.execute(httpGet); | ||
String result = EntityUtils.toString(execute.getEntity(), "UTF-8"); | ||
return result; | ||
} | ||
|
||
/** | ||
* 获取RequestConfig. | ||
* | ||
* @param timeout | ||
* 超时时间 | ||
* @return RequestConfig | ||
*/ | ||
public static RequestConfig getRequestConfig(int timeout) { | ||
RequestConfig requestConfig = RequestConfig.custom().setConnectionRequestTimeout(timeout).setSocketTimeout(timeout).setConnectTimeout(timeout).build(); | ||
return requestConfig; | ||
} | ||
|
||
/** | ||
* 获取RequestConfig(默认超时timeoutDefault). | ||
* | ||
* @return RequestConfig | ||
*/ | ||
public static RequestConfig getDefaultRequestConfig() { | ||
if (null == requestConfigDefault) { | ||
synchronized (HttpClientUtil.class) { | ||
if (null == requestConfigDefault) { | ||
requestConfigDefault = RequestConfig.custom().setConnectionRequestTimeout(timeoutDefault).setSocketTimeout(timeoutDefault).setConnectTimeout(timeoutDefault).build(); | ||
} | ||
} | ||
} | ||
return requestConfigDefault; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/utils/SpringContextUtil.java → ...iaofan/util/spring/SpringContextUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package utils; | ||
package com.zxiaofan.util.spring; | ||
|
||
import java.util.Map; | ||
|
||
|
Oops, something went wrong.