adding case for when c:\temp does not exist on windows machine (#278)

This commit is contained in:
Keith Carlson Jr 2020-07-17 15:00:10 -04:00 committed by GitHub
parent e14de3b339
commit 77c1890ad2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -81,7 +81,12 @@ public class UtilitiesTests {
} else if (os.contains(LINUX)) {
return LINUX_TEMP_DIR;
} else if (os.toUpperCase().contains(WINDOWS)) {
return WIN_TEMP_DIR;
File tmp = new File("c:\\temp");
if(tmp.exists()) {
return WIN_TEMP_DIR;
} else {
return System.getProperty("java.io.tmpdir");
}
} else {
throw new IllegalStateException("OS not recognized...cannot verify created directories.");
}