use of com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo in project azure-tools-for-java by microsoft.
the class ProxyUtils method initProxy.
public static void initProxy() {
final HttpConfigurable instance = HttpConfigurable.getInstance();
if (instance != null && instance.USE_HTTP_PROXY) {
final ProxyInfo proxy = ProxyInfo.builder().source("intellij").host(instance.PROXY_HOST).port(instance.PROXY_PORT).username(instance.getProxyLogin()).password(instance.getPlainProxyPassword()).build();
Azure.az().config().setProxyInfo(proxy);
ProxyManager.getInstance().applyProxy();
}
}
use of com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo in project azure-tools-for-java by Microsoft.
the class ProxyUtils method initProxy.
public static void initProxy() {
final HttpConfigurable instance = HttpConfigurable.getInstance();
if (instance != null && instance.USE_HTTP_PROXY) {
final ProxyInfo proxy = ProxyInfo.builder().source("intellij").host(instance.PROXY_HOST).port(instance.PROXY_PORT).username(instance.getProxyLogin()).password(instance.getPlainProxyPassword()).build();
Azure.az().config().setProxyInfo(proxy);
ProxyManager.getInstance().applyProxy();
}
}
use of com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo in project azure-maven-plugins by microsoft.
the class AbstractAzureMojo method initMavenSettingsProxy.
private static void initMavenSettingsProxy(MavenExecutionRequest request) {
if (request != null) {
final List<Proxy> mavenProxies = request.getProxies();
if (CollectionUtils.isNotEmpty(mavenProxies)) {
final Proxy mavenProxy = mavenProxies.stream().filter(proxy -> proxy.isActive() && proxy.getPort() > 0 && StringUtils.isNotBlank(proxy.getHost())).findFirst().orElse(null);
if (mavenProxy != null) {
final ProxyInfo mavenProxyInfo = ProxyInfo.builder().source("maven").host(mavenProxy.getHost()).port(mavenProxy.getPort()).username(mavenProxy.getUsername()).password(mavenProxy.getPassword()).build();
Azure.az().config().setProxyInfo(mavenProxyInfo);
}
}
}
}
Aggregations