From 77c1890ad2d50d6c236d3cfdb154fc6f28ca7098 Mon Sep 17 00:00:00 2001 From: Keith Carlson Jr <31493326+imkacarlson@users.noreply.github.com> Date: Fri, 17 Jul 2020 15:00:10 -0400 Subject: [PATCH] adding case for when c:\temp does not exist on windows machine (#278) --- .../java/org/hl7/fhir/utilities/tests/UtilitiesTests.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/UtilitiesTests.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/UtilitiesTests.java index 5240bbf8d..8dd6ffc12 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/UtilitiesTests.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/UtilitiesTests.java @@ -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."); }