propertyconfiguration.java
来自「一个搜索引擎,希望对大家有用」· Java 代码 · 共 65 行
JAVA
65 行
package com.luceneheritrixbook.searchengine.config;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
public class PropertyConfiguration {
/* property file identifier */
private static String CONFIG_FILE = "app";
private static ResourceBundle bundle;
static {
try {
bundle = ResourceBundle.getBundle(CONFIG_FILE);
} catch (MissingResourceException e) {
e.printStackTrace();
}
}
private static String getValue(String key) {
return bundle.getString(key);
}
public static String getDBUrl() {
String val = getValue("jdbc.url");
return val;
}
public static String getDBUsr() {
String val = getValue("jdbc.username");
return val;
}
public static String getDBPwd() {
String val = getValue("jdbc.password");
return val;
}
public static String getProductDir() {
String val = getValue("product.directory");
return val;
}
public static String getIndexStorePath() {
String val = getValue("product.index.directory");
return val;
}
public static String getProductMobileDir() {
String val = getValue("product.mobile.directory");
return val;
}
public static String getProductImageDir() {
String val = getValue("product.image.directory");
return val;
}
public static String getWordDictionary() {
String val = getValue("word.dictionary.file");
return val;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?