smolnar82 commented on code in PR #1018: URL: https://github.com/apache/knox/pull/1018#discussion_r2033331233
########## gateway-util-launcher/src/main/java/org/apache/knox/gateway/launcher/GatewayServerClasspathExtender.java: ########## @@ -99,4 +100,19 @@ private boolean startsWithDelimiter(String path) { return Arrays.stream(CLASS_PATH_DELIMITERS).anyMatch(path::startsWith); } + private Path getGatewayConfDir() { + String configDir = getVar(KNOX_GATEWAY_CONF_DIR_VAR, base.getPath() + CONFIG_PATH); + return Paths.get(configDir, CONFIG_FILE); + } + + private String getVar(String variableName, String defaultValue) { + String value = System.getProperty(variableName); + if (value == null) { + value = System.getenv(variableName); + } + if (value == null) { + value = defaultValue; + } + return value; Review Comment: nit: ``` return Optional.ofNullable(System.getProperty(variableName)) .or(() -> Optional.ofNullable(System.getenv(variableName))) .orElse(defaultValue); ``` This might be more concise, but your code works too. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org