BAEL-3651: Make sure the directory is always initially empty
This commit is contained in:
parent
fccdc24ad5
commit
0c61a12d88
|
@ -156,10 +156,16 @@ public class FileClassUnitTest {
|
||||||
|
|
||||||
private static File makeDir(String name) {
|
private static File makeDir(String name) {
|
||||||
File directory = new File(name);
|
File directory = new File(name);
|
||||||
directory.mkdir();
|
|
||||||
if (directory.isDirectory()) {
|
// If the directory already exists, make sure we create it 'from scratch', i.e. all the files inside are deleted first
|
||||||
|
if (directory.exists()) {
|
||||||
|
removeDir(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (directory.mkdir()) {
|
||||||
return directory;
|
return directory;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new RuntimeException("'" + name + "' not made!");
|
throw new RuntimeException("'" + name + "' not made!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue