public final class ConfigManager extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
configFileName |
private String |
contextPath |
private org.json.JSONObject |
jsonConfig |
private String |
originalPath |
private String |
parentPath |
private static String |
REMOTE_FILE_NAME |
private String |
rootPath |
private static String |
SCRAWL_FILE_NAME |
| 限定符 | 构造器和说明 |
|---|---|
private |
ConfigManager(String rootPath,
String contextPath,
String uri) |
| 限定符和类型 | 方法和说明 |
|---|---|
private String |
filter(String input) |
org.json.JSONObject |
getAllConfig() |
private String[] |
getArray(String key) |
Map<String,Object> |
getConfig(int type) |
private String |
getConfigPath() |
static ConfigManager |
getInstance(String rootPath,
String contextPath,
String uri)
配置管理器构造工厂
|
private void |
initEnv() |
private String |
readFile(String path) |
boolean |
valid() |
private final String rootPath
private final String originalPath
private final String contextPath
private String parentPath
private org.json.JSONObject jsonConfig
private ConfigManager(String rootPath, String contextPath, String uri) throws FileNotFoundException, IOException
public static ConfigManager getInstance(String rootPath, String contextPath, String uri)
rootPath - 服务器根路径contextPath - 服务器所在项目路径uri - 当前访问的uripublic boolean valid()
public org.json.JSONObject getAllConfig()
private void initEnv()
throws FileNotFoundException,
IOException
private String getConfigPath()
private String readFile(String path) throws IOException
IOExceptionCopyright © 2017. All Rights Reserved.