Properties
public Properties getPropValue() {
Properties prop = new Properties();
try {
// prop.load(new FileInputStream(new ConstantsValue().PROPERTIES_PATH));
String filename = "config.properties";
// prop.load(getClass().getClassLoader().getResourceAsStream(filename));
prop.load(getClass().getResourceAsStream(filename));
} catch (IOException ex) {
ex.printStackTrace();
}
return prop;
}
Properties prop = new Properties();
try {
// prop.load(new FileInputStream(new ConstantsValue().PROPERTIES_PATH));
String filename = "config.properties";
// prop.load(getClass().getClassLoader().getResourceAsStream(filename));
prop.load(getClass().getResourceAsStream(filename));
} catch (IOException ex) {
ex.printStackTrace();
}
return prop;
}
Call Method
public static void main(String[] args) {
// TODO Auto-generated method stub
String path = new PropUtil().getPropValue().getProperty("FILE_PATH");
}
config.properties
FILE_PATH= download\\bill
댓글
댓글 쓰기