deleteTotally(file);
if (!file.mkdir()) {
throw new IOException("Can't create directory '" + file + "'.");
}
return new TemporaryDirectory(file.getAbsolutePath());
<BUG>}
public static File createTemporaryDirectory(String prefix, File parentDirectory) throws IOException {</BUG>
File temporaryDirectory = new File(parentDirectory, prefix + '-' + RandomUtil.getRandomToken());
ensureDirectoryExists(temporaryDirectory);
return new TemporaryDirectory(temporaryDirectory.getAbsolutePath());

deleteTotally(file);
if (!file.mkdir()) {
throw new IOException("Can't create directory '" + file + "'.");
}
return new TemporaryDirectory(file.getAbsolutePath());
}
@Nonnull
public static File createTemporaryDirectory(String prefix, File parentDirectory) throws IOException {
File temporaryDirectory = new File(parentDirectory, prefix + '-' + RandomUtil.getRandomToken());
ensureDirectoryExists(temporaryDirectory);
return new TemporaryDirectory(temporaryDirectory.getAbsolutePath());
