Merge pull request #8383 from kwoyke/BAEL-3651

BAEL-3651: Fix failing test in core-java-io-apis
This commit is contained in:
Loredana Crusoveanu 2019-12-15 22:17:15 +02:00 committed by GitHub
commit d170631d7f
1 changed files with 8 additions and 2 deletions

View File

@ -156,10 +156,16 @@ public class FileClassUnitTest {
private static File makeDir(String 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;
}
throw new RuntimeException("'" + name + "' not made!");
}