import java.io.IOException;
import java.util.Properties;
public class ConfigProperties {
private static final String SERVER = "server.path";
private static final String CONFIG="/PathConfig.properties";
private Properties cfg;
public ConfigProperties() {
cfg = new Properties();
String fileName = CONFIG;
try {
cfg.load(getClass().getResourceAsStream(fileName));
} catch (IOException e) {
e.printStackTrace();
}
}
public String getServerPath() {
return cfg.getProperty(SERVER);
}
}
import java.util.Properties;
public class ConfigProperties {
private static final String SERVER = "server.path";
private static final String CONFIG="/PathConfig.properties";
private Properties cfg;
public ConfigProperties() {
cfg = new Properties();
String fileName = CONFIG;
try {
cfg.load(getClass().getResourceAsStream(fileName));
} catch (IOException e) {
e.printStackTrace();
}
}
public String getServerPath() {
return cfg.getProperty(SERVER);
}
}