private void setSystemPropertyToDefaultIfNotSet(JvmOptions jvmOptions, String httpsProperty, String httpProperty) { Optional<String> httpValue = getPropsValue(httpProperty); Optional<String> httpsValue = getPropsValue(httpsProperty); if (!httpsValue.isPresent() && httpValue.isPresent()) { jvmOptions.add("-D" + httpsProperty + "=" + httpValue.get()); } }
private <T extends JvmOptions> void addProxyJvmOptions(JvmOptions<T> jvmOptions) { for (String key : PROXY_PROPERTY_KEYS) { getPropsValue(key).ifPresent(val -> jvmOptions.add("-D" + key + "=" + val)); } // defaults of HTTPS are the same than HTTP defaults setSystemPropertyToDefaultIfNotSet(jvmOptions, HTTPS_PROXY_HOST.getKey(), HTTP_PROXY_HOST.getKey()); setSystemPropertyToDefaultIfNotSet(jvmOptions, HTTPS_PROXY_PORT.getKey(), HTTP_PROXY_PORT.getKey()); }
private void setSystemPropertyToDefaultIfNotSet(JvmOptions jvmOptions, String httpsProperty, String httpProperty) { Optional<String> httpValue = getPropsValue(httpProperty); Optional<String> httpsValue = getPropsValue(httpsProperty); if (!httpsValue.isPresent() && httpValue.isPresent()) { jvmOptions.add("-D" + httpsProperty + "=" + httpValue.get()); } }
private <T extends JvmOptions> void addProxyJvmOptions(JvmOptions<T> jvmOptions) { for (String key : PROXY_PROPERTY_KEYS) { getPropsValue(key).ifPresent(val -> jvmOptions.add("-D" + key + "=" + val)); } // defaults of HTTPS are the same than HTTP defaults setSystemPropertyToDefaultIfNotSet(jvmOptions, HTTPS_PROXY_HOST, HTTP_PROXY_HOST); setSystemPropertyToDefaultIfNotSet(jvmOptions, HTTPS_PROXY_PORT, HTTP_PROXY_PORT); }