Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static Properties loadProperties(String dirName, String fileName) {
- Properties properties = new Properties();
- if (dirName != null && fileName != null) {
- File dir = new File(dirName);
- File fileProp = new File(dir, fileName);
- if (fileProp.exists()) {
- try (InputStream is = new FileInputStream(fileProp)) {
- properties.load(is);
- } catch (IOException e) {
- throw new IllegalArgumentException("There was a problem with reading properties", e);
- }
- } else {
- log.warn("Missing config.properties file!");
- }
- }
- return properties;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement