| | |
| | | if (propertiesFile != null && propertiesFile.exists() && (forceReload || (propertiesFile.lastModified() > lastModified))) {
|
| | | FileInputStream is = null;
|
| | | try {
|
| | | logger.debug("loading {}", propertiesFile);
|
| | | Properties props = new Properties();
|
| | | is = new FileInputStream(propertiesFile);
|
| | | props.load(is);
|
| | |
| | | if (!StringUtils.isEmpty(include)) {
|
| | |
|
| | | // allow for multiples
|
| | | List<String> names = StringUtils.getStringsFromValue(include, " ");
|
| | | List<String> names = StringUtils.getStringsFromValue(include, ",");
|
| | | for (String name : names) {
|
| | |
|
| | | if (StringUtils.isEmpty(name)) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // try co-located
|
| | | File file = new File(propertiesFile.getParentFile(), name.trim());
|
| | |
| | | file = new File(name.trim());
|
| | | }
|
| | |
|
| | | if (file.exists()) {
|
| | | if (!file.exists()) {
|
| | | logger.warn("failed to locate {}", file);
|
| | | continue;
|
| | | }
|
| | |
|
| | | // load properties
|
| | | logger.debug("loading {}", file);
|
| | | try (FileInputStream iis = new FileInputStream(file)) {
|
| | | baseProperties.load(iis);
|
| | | }
|
| | |
|
| | | // read nested includes
|
| | | baseProperties = readIncludes(baseProperties);
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
|