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


Java ProxyInfo类代码示例

本文整理汇总了Java中org.apache.maven.wagon.proxy.ProxyInfo的典型用法代码示例。如果您正苦于以下问题:Java ProxyInfo类的具体用法?Java ProxyInfo怎么用?Java ProxyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ProxyInfo类属于org.apache.maven.wagon.proxy包,在下文中一共展示了ProxyInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFetcher

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
private WagonHelper.WagonFetcher createFetcher(final Wagon wagon, TransferListener listener, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) {
    if(isDiag()) {
        return new WagonHelper.WagonFetcher(wagon, listener, authenticationInfo, proxyInfo) {
            @Override
            public InputStream retrieve(String name) throws IOException, FileNotFoundException {
                String id = wagon.getRepository().getId();
                if(name.contains("properties") && System.getProperty("maven.diag.index.properties." + id) != null) { // NOI18N
                    LOGGER.log(Level.INFO, "maven indexer will use local properties file: {0}", System.getProperty("maven.diag.index.properties." + id)); // NOI18N
                    return new FileInputStream(new File(System.getProperty("maven.diag.index.properties." + id))); // NOI18N
                } else if(name.contains(".gz") && System.getProperty("maven.diag.index.gz." + id) != null) { // NOI18N
                    LOGGER.log(Level.INFO, "maven indexer will use gz file: {0}", System.getProperty("maven.diag.index.gz." + id)); // NOI18N
                    return new FileInputStream(new File(System.getProperty("maven.diag.index.gz." + id))); // NOI18N
                }
                return super.retrieve(name);
            }
        };
    } else {
        return new WagonHelper.WagonFetcher(wagon, listener, authenticationInfo, proxyInfo);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:NexusRepositoryIndexerImpl.java

示例2: createWagon

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
Wagon createWagon(String serverId, String url) throws WagonException {
  Repository repository = new Repository(serverId, url);
  Wagon wagon = wagonManager.getWagon(repository);

  if (getLog().isDebugEnabled()) {
    Debug debug = new Debug();
    wagon.addSessionListener(debug);
    wagon.addTransferListener(debug);
  }

  ProxyInfo proxyInfo = getProxyInfo();
  if (proxyInfo != null) {
    wagon
        .connect(repository, wagonManager.getAuthenticationInfo(repository.getId()), proxyInfo);
  } else {
    wagon.connect(repository, wagonManager.getAuthenticationInfo(repository.getId()));
  }
  return wagon;
}
 
开发者ID:chonton,项目名称:exists-maven-plugin,代码行数:20,代码来源:RemoteExistsMojo.java

示例3: createWagon

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
/**
 * Convenience method to create a wagon.
 *
 * @param serverId     The serverId to use if the wagonManager needs help.
 * @param url          The url to create a wagon for.
 * @param wagonManager The wgaon manager to use.
 * @param settings     The settings to use.
 * @param logger       The logger to use.
 * @return The wagon to connect to the url.
 * @throws org.apache.maven.wagon.UnsupportedProtocolException
 *          if the protocol is not supported.
 * @throws org.apache.maven.artifact.manager.WagonConfigurationException
 *          if the wagon cannot be configured.
 * @throws org.apache.maven.wagon.ConnectionException
 *          If the connection cannot be established.
 * @throws org.apache.maven.wagon.authentication.AuthenticationException
 *          If the connection cannot be authenticated.
 */
public static Wagon createWagon( String serverId, String url, WagonManager wagonManager, Settings settings,
                                 Log logger )
    throws UnsupportedProtocolException, WagonConfigurationException, ConnectionException, AuthenticationException
{
    Repository repository = new Repository( serverId, url );
    Wagon wagon = wagonManager.getWagon( repository );

    if ( logger.isDebugEnabled() )
    {
        Debug debug = new Debug();
        wagon.addSessionListener( debug );
        wagon.addTransferListener( debug );
    }

    ProxyInfo proxyInfo = getProxyInfo( settings );
    if ( proxyInfo != null )
    {
        wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ), proxyInfo );
    }
    else
    {
        wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ) );
    }
    return wagon;
}
 
开发者ID:petr-ujezdsky,项目名称:versions-maven-plugin-svn-clone,代码行数:44,代码来源:WagonUtils.java

示例4: 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;
}
 
开发者ID:chonton,项目名称:exists-maven-plugin,代码行数:15,代码来源:RemoteExistsMojo.java

示例5: getClientConfiguration

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
static ClientConfiguration getClientConfiguration(ProxyInfoProvider proxyInfoProvider) {
    ClientConfiguration clientConfiguration = new ClientConfiguration();

    if (proxyInfoProvider != null) {
        ProxyInfo proxyInfo = proxyInfoProvider.getProxyInfo("s3");
        if (proxyInfo != null) {
            clientConfiguration.withProxyHost(proxyInfo.getHost()).withProxyPort(proxyInfo.getPort());
        }
    }

    return clientConfiguration;
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:13,代码来源:S3Utils.java

示例6: getProxyInfo

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
@Override
public ProxyInfo getProxyInfo(String protocol) {
    if ((protocol == null) || (this.proxyInfo == null) || protocol.equalsIgnoreCase(this.proxyInfo.getType())) {
        return this.proxyInfo;
    } else {
        return null;
    }
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:9,代码来源:NullProtectingProxyInfoProvider.java

示例7: createWagon

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
/**
 * Convenience method to create a wagon.
 *
 * @param serverId The serverId to use if the wagonManager needs help.
 * @param url The url to create a wagon for.
 * @param wagonManager The wgaon manager to use.
 * @param settings The settings to use.
 * @param logger The logger to use.
 * @return The wagon to connect to the url.
 * @throws org.apache.maven.wagon.UnsupportedProtocolException if the protocol is not supported.
 * @throws org.apache.maven.artifact.manager.WagonConfigurationException if the wagon cannot be configured.
 * @throws org.apache.maven.wagon.ConnectionException If the connection cannot be established.
 * @throws org.apache.maven.wagon.authentication.AuthenticationException If the connection cannot be authenticated.
 */
public static Wagon createWagon( String serverId, String url, WagonManager wagonManager, Settings settings,
                                 Log logger )
                                     throws UnsupportedProtocolException, WagonConfigurationException,
                                     ConnectionException, AuthenticationException
{
    Repository repository = new Repository( serverId, url );
    Wagon wagon = wagonManager.getWagon( repository );

    if ( logger.isDebugEnabled() )
    {
        Debug debug = new Debug();
        wagon.addSessionListener( debug );
        wagon.addTransferListener( debug );
    }

    ProxyInfo proxyInfo = getProxyInfo( settings );
    if ( proxyInfo != null )
    {
        wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ), proxyInfo );
    }
    else
    {
        wagon.connect( repository, wagonManager.getAuthenticationInfo( repository.getId() ) );
    }
    return wagon;
}
 
开发者ID:mojohaus,项目名称:versions-maven-plugin,代码行数:41,代码来源:WagonUtils.java

示例8: getProxyInfo

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
public static ProxyInfo getProxyInfo(Repository repository, WagonManager wagonManager) {
    ProxyInfo proxyInfo = wagonManager.getProxy(repository.getProtocol());

    if (proxyInfo == null) {
        return null;
    }

    String host = repository.getHost();
    String nonProxyHostsAsString = proxyInfo.getNonProxyHosts();
    for (String nonProxyHost : StringUtils.split(nonProxyHostsAsString, ",;|")) {
        if (org.apache.commons.lang.StringUtils.contains(nonProxyHost, "*")) {
            // Handle wildcard at the end, beginning or middle of the nonProxyHost
            final int pos = nonProxyHost.indexOf('*');
            String nonProxyHostPrefix = nonProxyHost.substring(0, pos);
            String nonProxyHostSuffix = nonProxyHost.substring(pos + 1);
            // prefix*
            if (StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith(nonProxyHostPrefix)
                    && StringUtils.isEmpty(nonProxyHostSuffix)) {
                return null;
            }
            // *suffix
            if (StringUtils.isEmpty(nonProxyHostPrefix)
                    && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith(nonProxyHostSuffix)) {
                return null;
            }
            // prefix*suffix
            if (StringUtils.isNotEmpty(nonProxyHostPrefix) && host.startsWith(nonProxyHostPrefix)
                    && StringUtils.isNotEmpty(nonProxyHostSuffix) && host.endsWith(nonProxyHostSuffix)) {
                return null;
            }
        } else if (host.equals(nonProxyHost)) {
            return null;
        }
    }
    return proxyInfo;
}
 
开发者ID:opoo,项目名称:opoopress,代码行数:37,代码来源:AbstractDeployMojo.java

示例9: 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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:33,代码来源:LegacyRepositorySystem.java

示例10: 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;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:40,代码来源:DefaultWagonManager.java

示例11: connect

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
@Override
public final void connect(Repository repository, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException {
    connect(repository);
}
 
开发者ID:lxxlxx888,项目名称:Reer,代码行数:5,代码来源:RepositoryTransportDeployWagon.java

示例12: connect

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
@Override
public void connect( Repository source, ProxyInfo proxyInfo )
    throws ConnectionException, AuthenticationException
{
    delegate.connect( source, proxyInfo );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:WagonDelegate.java

示例13: connect

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
@Override
public void connect( Repository repository, ProxyInfo proxyInfo )
    throws ConnectionException, AuthenticationException
{

}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:7,代码来源:MockWagon.java

示例14: NullProtectingProxyInfoProvider

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
NullProtectingProxyInfoProvider(ProxyInfo proxyInfo) {
    this.proxyInfo = proxyInfo;
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:4,代码来源:NullProtectingProxyInfoProvider.java

示例15: connect

import org.apache.maven.wagon.proxy.ProxyInfo; //导入依赖的package包/类
@Override
public final void connect(Repository source, ProxyInfo proxyInfo) throws ConnectionException,
        AuthenticationException {
    connect(source, null, proxyInfo);
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:6,代码来源:AbstractWagon.java


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