Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 7712945

Browse files
committed
#103 Added fix for when a properties file doesn't have a parent file
1 parent c22b87a commit 7712945

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/java/com/marklogic/client/ext/modulesloader/impl/PropertiesModuleManager.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ public PropertiesModuleManager(String propertiesFilePath) {
2929
@Override
3030
public void initialize() {
3131
File propertiesFile = new File(propertiesFilePath);
32-
propertiesFile.getParentFile().mkdirs();
33-
if (propertiesFile.exists()) {
32+
33+
if (propertiesFile.getParentFile() != null) {
34+
propertiesFile.getParentFile().mkdirs();
35+
}
36+
37+
if (propertiesFile.exists()) {
3438
FileInputStream fis = null;
3539
try {
3640
fis = new FileInputStream(propertiesFile);
@@ -47,7 +51,9 @@ public void initialize() {
4751
logger.warn(e.getMessage());
4852
}
4953
}
50-
}
54+
} else {
55+
logger.warn("File path does not exist, so will not save timestamps to it: " + propertiesFile);
56+
}
5157
}
5258

5359
public void deletePropertiesFile() {

0 commit comments

Comments
 (0)