From 57f7e2d0ee2ab4e7bf54062e12254916b8ba2907 Mon Sep 17 00:00:00 2001 From: dotasek Date: Wed, 13 Sep 2023 23:03:16 -0400 Subject: [PATCH] Remove env variables from paths --- .../src/main/java/org/hl7/fhir/utilities/PathBuilder.java | 7 ------- .../test/java/org/hl7/fhir/utilities/UtilitiesTest.java | 7 +------ 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java index b546b1a37..6cf9edeb6 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/PathBuilder.java @@ -175,13 +175,6 @@ public class PathBuilder { } } else if ("[user]".equals(a)) { return System.getProperty("user.home"); - } else if (a.startsWith("[") && a.endsWith("]")) { - String ev = System.getenv(a.replace("[", "").replace("]", "")); - if (ev != null) { - return ev; - } else { - return "null"; - } } return a; } diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java index c91f1508e..c5658b5a2 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/UtilitiesTest.java @@ -13,6 +13,7 @@ import java.util.stream.Stream; import org.apache.commons.lang3.SystemUtils; import org.hl7.fhir.utilities.settings.FhirSettings; import org.junit.jupiter.api.Assertions; + import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; @@ -59,12 +60,6 @@ class UtilitiesTest { assertEquals(Utilities.path("[user]", TEST_TXT), getUserDirectory() + TEST_TXT); } - @Test - @DisplayName("Test Utilities.path maps JAVA_HOME correctly") - public void testJavaHomeDirPath() throws IOException { - assertEquals(Utilities.path("[JAVA_HOME]", TEST_TXT), getJavaHomeDirectory() + TEST_TXT); - } - private String getJavaHomeDirectory() { String os = SystemUtils.OS_NAME; if (os.contains(OSX) || os.contains(MAC)) {