|
发表于 2005-1-25 09:11:50
|
显示全部楼层
- import java.io.*;
- import java.util.*;
- import javax.servlet.ServletConfig;
- import javax.servlet.ServletException;
- import java.rmi.RemoteException;
- import java.util.Iterator;
- import java.util.Properties;
- // Referenced classes of package net.line.fortress.apps.system:
- // InvalidConfigException
- public class SystemConfig {
- static SystemConfig sysconf = null;
- Properties pro = null;
- private SystemConfig() {
- pro = new Properties();
- ClassLoader cl = this.getClass().getClassLoader();
- InputStream is = cl.getResourceAsStream("system.properties");
- try {
- pro.load(is);
- }
- catch (IOException ex) {
- ex.printStackTrace();
- }
- }
- public static SystemConfig newInstance() {
- if (sysconf == null) {
- sysconf = new SystemConfig();
- }
- return sysconf;
- }
- public String get(String property) {
- return pro.getProperty(property);
- }
- }
复制代码 |
|