package com.sinosoft.media.sms.util;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
/**
* @ClassName: UtilTool
* @Description: 通用工具类
*
*/
public class UtilTool {
/**
* @Title: initConf
* @Description: 读取配置文件
*/
public static Properties initConf() {
Properties p = new Properties();
try {
p.load(Thread.currentThread().getContextClassLoader()
.getResourceAsStream("config/data.properties"));
} catch (IOException e) {
e.printStackTrace();
}
return p;
}
public static Properties getProperties(String path){
Properties p = new Properties();
try {
p.load(Thread.currentThread().getContextClassLoader()
.getResourceAsStream(path));
} catch (IOException e) {
e.printStackTrace();
}
return p;
}
//随即生成指定长度的字母和数字混合的字符串
public static String getIndex() {
return getCharAndNumr(9);
}
//随即生成length长度的字母数字组合的字符串
private static String getCharAndNumr(int length) {
String val = "";
Ran
UtilTool通用工具类
最新推荐文章于 2023-12-16 17:24:31 发布