当前位置: 首页>>代码示例>>Java>>正文


Java SettingsDecryptionResult.getProxy方法代码示例

本文整理汇总了Java中org.apache.maven.settings.crypto.SettingsDecryptionResult.getProxy方法的典型用法代码示例。如果您正苦于以下问题:Java SettingsDecryptionResult.getProxy方法的具体用法?Java SettingsDecryptionResult.getProxy怎么用?Java SettingsDecryptionResult.getProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.maven.settings.crypto.SettingsDecryptionResult的用法示例。


在下文中一共展示了SettingsDecryptionResult.getProxy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectProxy

import org.apache.maven.settings.crypto.SettingsDecryptionResult; //导入方法依赖的package包/类
public void injectProxy( List<ArtifactRepository> repositories, List<org.apache.maven.settings.Proxy> proxies )
{
    if ( repositories != null )
    {
        for ( ArtifactRepository repository : repositories )
        {
            org.apache.maven.settings.Proxy proxy = getProxy( repository, proxies );

            if ( proxy != null )
            {
                SettingsDecryptionRequest request = new DefaultSettingsDecryptionRequest( proxy );
                SettingsDecryptionResult result = settingsDecrypter.decrypt( request );
                proxy = result.getProxy();

                if ( logger.isDebugEnabled() )
                {
                    for ( SettingsProblem problem : result.getProblems() )
                    {
                        logger.debug( problem.getMessage(), problem.getException() );
                    }
                }

                Proxy p = new Proxy();
                p.setHost( proxy.getHost() );
                p.setProtocol( proxy.getProtocol() );
                p.setPort( proxy.getPort() );
                p.setNonProxyHosts( proxy.getNonProxyHosts() );
                p.setUserName( proxy.getUsername() );
                p.setPassword( proxy.getPassword() );

                repository.setProxy( p );
            }
            else
            {
                repository.setProxy( null );
            }
        }
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:LegacyRepositorySystem.java

示例2: getProxy

import org.apache.maven.settings.crypto.SettingsDecryptionResult; //导入方法依赖的package包/类
public ProxyInfo getProxy( String protocol )
{
    MavenSession session = legacySupport.getSession();

    if ( session != null && protocol != null )
    {
        MavenExecutionRequest request = session.getRequest();

        if ( request != null )
        {
            List<Proxy> proxies = request.getProxies();

            if ( proxies != null )
            {
                for ( Proxy proxy : proxies )
                {
                    if ( proxy.isActive() && protocol.equalsIgnoreCase( proxy.getProtocol() ) )
                    {
                        SettingsDecryptionResult result =
                            settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( proxy ) );
                        proxy = result.getProxy();

                        ProxyInfo proxyInfo = new ProxyInfo();
                        proxyInfo.setHost( proxy.getHost() );
                        proxyInfo.setType( proxy.getProtocol() );
                        proxyInfo.setPort( proxy.getPort() );
                        proxyInfo.setNonProxyHosts( proxy.getNonProxyHosts() );
                        proxyInfo.setUserName( proxy.getUsername() );
                        proxyInfo.setPassword( proxy.getPassword() );

                        return proxyInfo;
                    }
                }
            }
        }
    }

    return null;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:DefaultWagonManager.java

示例3: decryptProxy

import org.apache.maven.settings.crypto.SettingsDecryptionResult; //导入方法依赖的package包/类
private static Proxy decryptProxy(Proxy proxy, SettingsDecrypter decrypter) {
    final DefaultSettingsDecryptionRequest decryptionRequest = new DefaultSettingsDecryptionRequest(proxy);
    SettingsDecryptionResult decryptedResult = decrypter.decrypt(decryptionRequest);
    return decryptedResult.getProxy();
}
 
开发者ID:eirslett,项目名称:frontend-maven-plugin,代码行数:6,代码来源:MojoUtils.java

示例4: decryptProxy

import org.apache.maven.settings.crypto.SettingsDecryptionResult; //导入方法依赖的package包/类
private static Proxy decryptProxy(Proxy proxy, SettingsDecrypter decrypter) {
    final DefaultSettingsDecryptionRequest decryptionRequest =
            new DefaultSettingsDecryptionRequest(proxy);
    SettingsDecryptionResult decryptedResult = decrypter.decrypt(decryptionRequest);
    return decryptedResult.getProxy();
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:7,代码来源:MojoUtils.java


注:本文中的org.apache.maven.settings.crypto.SettingsDecryptionResult.getProxy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。