package com.glsx.conf;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class ConfigurationManager {
private static Properties prop = new Properties();
static {
InputStream inputStream = ConfigurationManager.class.getClassLoader().getResourceAsStream("conf/my.properties");
try {
prop.load(inputStream);
} catch (IOException e) {
e.printStackTrace();
}
}
public static String getString(String key) { return prop.getProperty(key); }
public static Integer getInteger(String key) { return Integer.valueOf(prop.getProperty(key)); }
public static Boolean getBoolean(String key) {
return Boolean.valueOf(prop.getProperty(key));
}
public static Long getLong(String key) {
return Long.valueOf(prop.getProperty(key));
}
public static Double getDouble(String key) {
return Double.valueOf(prop.getProperty(key));
}
public static void main(String[] args) {
System.out.println(ConfigurationManager.getString("hbase.zookeeper.quorum"));
}
}
我喜欢一无所有,这样就只能一步一步的创造世界...