Remove env variables from paths
This commit is contained in:
parent
a8967b378f
commit
57f7e2d0ee
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue