Skip to content

Commit 4f200cf

Browse files
authored
[#4] Add logs when unable to create bundle temp directory (#31)
1 parent 05a02d8 commit 4f200cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

OpenICF-java-framework/connector-framework-internal/src/main/java/org/identityconnectors/framework/impl/api/local/LocalConnectorInfoManagerImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,16 @@ private File getBundleTempDir() throws IOException {
489489
if (!tempDir.exists()) {
490490
throw new IOException("Temporary directory " + tempDir + " does not exist");
491491
}
492+
if (!tempDir.canWrite()) {
493+
throw new IOException("Temporary directory " + tempDir + " is read/only");
494+
}
492495
File candidate;
493496
do {
494497
candidate = new File(tempDir, "bundle-" + nextRandom());
495-
} while (!candidate.mkdir());
498+
} while (candidate.exists());
499+
if (!candidate.mkdir()) {
500+
throw new IOException("Temporary directory " + tempDir + " is read/only");
501+
}
496502
candidate.deleteOnExit();
497503
_bundleTempDir = candidate;
498504
return candidate;

0 commit comments

Comments
 (0)