📄 propertiesmanager.java
字号:
package ksnb;
import java.io.FileNotFoundException;
import java.util.Hashtable;
import java.util.Properties;
public class PropertiesManager {
private static Hashtable propertiesCache;
private static java.lang.Object loaderLock;
static {
loaderLock = new Object();
}
/**
* PropertiesManager Constructor
*/
public PropertiesManager() {
super();
}
/**
* Acquire one configuration information
* Create timestamp(2003-09-30 11:00:10)
* @return java.util.Properties
* @param propertiesFileName java.lang.String
*/
public static java.util.Properties getProperties(String propertiesFileName)
throws java.io.FileNotFoundException {
if (propertiesCache == null || propertiesCache.get(propertiesFileName) == null)
synchronized (loaderLock) {
if (propertiesCache == null
|| propertiesCache.get(propertiesFileName) == null) {
propertiesCache = new Hashtable();
propertiesCache.put(
propertiesFileName,
new PropertiesLoader().getProperties(propertiesFileName));
}
}
return (Properties) propertiesCache.get(propertiesFileName);
}
/**
* Initialize information
* Create timestamp(2003-09-30 11:03:32)
*/
public static void reset() {
propertiesCache = null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -