本文整理汇总了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 );
}
}
}
}
示例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;
}
示例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();
}
示例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();
}