[TEST] delete and recreate config dir if already existing
Original commit: elastic/x-pack-elasticsearch@90af42b95d
This commit is contained in:
parent
a995ed9cca
commit
8c1fcb52ea
|
@ -151,6 +151,11 @@ public class ShieldSettingsSource extends ClusterDiscoveryConfiguration.UnicastZ
|
|||
|
||||
private static File createFolder(File parent, String name) {
|
||||
File createdFolder = new File(parent, name);
|
||||
if (createdFolder.exists()) {
|
||||
if (!createdFolder.delete()) {
|
||||
throw new RuntimeException("Could not delete existing temporary folder: " + createdFolder.getAbsolutePath());
|
||||
}
|
||||
}
|
||||
if (!createdFolder.mkdir()) {
|
||||
throw new RuntimeException("Could not create temporary folder: " + createdFolder.getAbsolutePath());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue