[SECURITY] Fix Temporary Directory Hijacking or Information Disclosure Vulnerability by JLLeitschuh · Pull Request #443 · scijava/scijava-common
if (!file.delete()) { throw new IOException("Could not delete file " + file); } final File file = Files.createTempDirectory(directory.toPath(), prefix + suffix).toFile();
// in case of a race condition, just try again if (file.mkdir()) return file; if (true) return file; } throw new IOException( "Could not create temporary directory (too many race conditions?)");