本文整理汇总了Java中org.apache.maven.wagon.proxy.ProxyInfo.setNonProxyHosts方法的典型用法代码示例。如果您正苦于以下问题:Java ProxyInfo.setNonProxyHosts方法的具体用法?Java ProxyInfo.setNonProxyHosts怎么用?Java ProxyInfo.setNonProxyHosts使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.maven.wagon.proxy.ProxyInfo
的用法示例。
在下文中一共展示了ProxyInfo.setNonProxyHosts方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProxyInfo
import org.apache.maven.wagon.proxy.ProxyInfo; //导入方法依赖的package包/类
ProxyInfo getProxyInfo() {
if (settings.getActiveProxy() == null) {
return null;
}
ProxyInfo proxyInfo = new ProxyInfo();
Proxy proxy = settings.getActiveProxy();
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;
}
示例2: getProxy
import org.apache.maven.wagon.proxy.ProxyInfo; //导入方法依赖的package包/类
private org.apache.maven.settings.Proxy getProxy( ArtifactRepository repository,
List<org.apache.maven.settings.Proxy> proxies )
{
if ( proxies != null && repository.getProtocol() != null )
{
for ( org.apache.maven.settings.Proxy proxy : proxies )
{
if ( proxy.isActive() && repository.getProtocol().equalsIgnoreCase( proxy.getProtocol() ) )
{
if ( StringUtils.isNotEmpty( proxy.getNonProxyHosts() ) )
{
ProxyInfo pi = new ProxyInfo();
pi.setNonProxyHosts( proxy.getNonProxyHosts() );
org.apache.maven.wagon.repository.Repository repo =
new org.apache.maven.wagon.repository.Repository( repository.getId(), repository.getUrl() );
if ( !ProxyUtils.validateNonProxyHosts( pi, repo.getHost() ) )
{
return proxy;
}
}
else
{
return proxy;
}
}
}
}
return null;
}
示例3: getProxy
import org.apache.maven.wagon.proxy.ProxyInfo; //导入方法依赖的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;
}