Fix detection of symlinks in acceptance tests
Delete of temporary files failed if the tmp folder in which the temporary directory was created is a symlink. Now, the temporary folder is canonicalized before it is used. This fixes this issue. Change-Id: Ic5aa91e5242b5b836131c11b05b8723c50b359d9
This commit is contained in:
parent
f130079302
commit
4b216ca643
@ -23,7 +23,7 @@ public class TempFileUtil {
|
||||
private static List<File> allDirsCreated = new ArrayList<>();
|
||||
|
||||
public synchronized static File createTempDirectory() throws IOException {
|
||||
File tmp = File.createTempFile("gerrit_test_", "");
|
||||
File tmp = File.createTempFile("gerrit_test_", "").getCanonicalFile();
|
||||
if (!tmp.delete() || !tmp.mkdir()) {
|
||||
throw new IOException("Cannot create " + tmp.getPath());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user