DBZ-1621 Fix IoUtil.createDirectory parameter removeExistingContent is not take effect
This commit is contained in:
parent
89fde5ce06
commit
91f0c2a520
@ -371,7 +371,9 @@ public static File createDirectory(Path path, boolean removeExistingContent) thr
|
||||
File dir = path.toAbsolutePath().toFile();
|
||||
if (dir.exists() && dir.canRead() && dir.canWrite()) {
|
||||
if (dir.isDirectory()) {
|
||||
delete(path);
|
||||
if (removeExistingContent) {
|
||||
delete(path);
|
||||
}
|
||||
return dir;
|
||||
}
|
||||
throw new IllegalStateException("Expecting '" + path + "' to be a directory but found a file");
|
||||
|
Loading…
Reference in New Issue
Block a user