您的位置:首页 > 运维架构

PropertiesUtil

2015-12-04 11:45 363 查看
PropertiesUtil

package com.test.propertise;

import java.io.IOException;
import java.util.Properties;

import org.junit.Test;

public class PropertiesUtil {
private static Properties pro;
static{
pro = new Properties();

try {
pro.load(PropertiesUtil.class.getResourceAsStream("/com/test/propertise/app.properties"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static String Get_By_Key(String key) {

return pro.getProperty(key);
}

}


app.properties

key=123456789
key2=woshishui
key3=hello world
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: