Search in sources :

Example 1 with ProxyInfo

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();
    }
}
Also used : ProxyInfo(com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo) HttpConfigurable(com.intellij.util.net.HttpConfigurable)

Example 2 with ProxyInfo

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();
    }
}
Also used : ProxyInfo(com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo) HttpConfigurable(com.intellij.util.net.HttpConfigurable)

Example 3 with ProxyInfo

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);
            }
        }
    }
}
Also used : ProxyInfo(com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo) Proxy(org.apache.maven.settings.Proxy)

Aggregations

ProxyInfo (com.microsoft.azure.toolkit.lib.common.proxy.ProxyInfo)3 HttpConfigurable (com.intellij.util.net.HttpConfigurable)2 Proxy (org.apache.maven.settings.Proxy)1