属性文件.properies:
Properties properties = FooUtil.read("/file.properties");
<pre name="code" class="java">public class FooUtil {
private static final Map<String, Properties> map = new HashMap<String, Properties>();
public static Properties read(String path)
throws IOException
{
Properties properties = (Properties)map.get(path);
if (properties == null)
{
properties = new Properties();
properties.load(FooUtil.class.getResourceAsStream(path));
map.put(path, properties);
}
return properties;
}
}