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


Java Proxy.getHost方法代码示例

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


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

示例1: getProxyConfig

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
static ProxyConfig getProxyConfig(MavenSession mavenSession) {
  if (
          mavenSession == null ||
                  mavenSession.getSettings() == null ||
                  mavenSession.getSettings().getActiveProxy() == null ||
                  !mavenSession.getSettings().getActiveProxy().isActive()
          ) {
    return null;
  } else {
    Proxy mavenProxy = mavenSession.getSettings().getActiveProxy();
    return new ProxyConfig(
            mavenProxy.getProtocol(),
            mavenProxy.getHost(),
            mavenProxy.getPort(),
            mavenProxy.getUsername(),
            mavenProxy.getPassword());
  }
}
 
开发者ID:RabbitStewDio,项目名称:frontend-tomcat-maven-plugin,代码行数:19,代码来源:MojoUtils.java

示例2: ProxySettings

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
public ProxySettings(@Nonnull final Proxy mavenProxy) {
    this.protocol = mavenProxy.getProtocol();
    this.host = mavenProxy.getHost();
    this.port = mavenProxy.getPort();
    this.username = mavenProxy.getUsername();
    this.password = mavenProxy.getPassword();
    this.nonProxyHosts = mavenProxy.getNonProxyHosts();
}
 
开发者ID:raydac,项目名称:mvn-golang,代码行数:9,代码来源:ProxySettings.java

示例3: proxyConfiguration

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
/**
 * Extract configuration from given maven proxy settings.
 *
 * @param proxy Proxy.
 * @return Proxy configuration.
 */
public static ProxyConfig proxyConfiguration(Proxy proxy) {
	return new ProxyConfig(
		proxy.getProtocol(),
		proxy.getUsername(),
		proxy.getPassword(),
		proxy.getHost(),
		proxy.getPort()
	);
}
 
开发者ID:mjeanroy,项目名称:node-maven-plugin,代码行数:16,代码来源:ProxyConfig.java

示例4: getActiveProxyAsHttpproxy

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
protected String getActiveProxyAsHttpproxy() {
	if (getSettings() == null) {
		return null;
	}

	final Settings settings = getSettings();

	final Proxy activeProxy = settings.getActiveProxy();
	if (activeProxy == null || activeProxy.getHost() == null) {
		return null;
	}

	return createXJCProxyArgument(activeProxy.getHost(), activeProxy.getPort(), activeProxy.getUsername(),
			activeProxy.getPassword());
}
 
开发者ID:highsource,项目名称:maven-jaxb2-plugin,代码行数:16,代码来源:RawXJC2Mojo.java

示例5: confluenceExecute

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
/**
 *
 * @param task
 * @throws MojoExecutionException
 */
protected <T extends Action1<ConfluenceService>> void confluenceExecute(T task) throws MojoExecutionException {

    ConfluenceService confluence = null;
    
    try {

        ConfluenceProxy proxyInfo = null;

        final Proxy activeProxy = mavenSettings.getActiveProxy();

        if (activeProxy != null) {

            proxyInfo =
                    new ConfluenceProxy(
                            activeProxy.getHost(),
                            activeProxy.getPort(),
                            activeProxy.getUsername(),
                            activeProxy.getPassword(),
                            activeProxy.getNonProxyHosts()
                    );
        }

        final ConfluenceService.Credentials credentials = 
            new ConfluenceService.Credentials(getUsername(), getPassword());

        confluence = 
                ConfluenceServiceFactory.createInstance(
                        getEndPoint(), 
                        credentials, 
                        proxyInfo, 
                        sslCertificate
                );

        getLog().info( String.valueOf(confluence) );

        confluence.call(task);
        
    } catch( RuntimeException re ) {
        
        throw re;
        
    } catch (Exception e) {

        final String msg = "has been impossible connect to confluence due exception";
        //getLog().error(msg, e);

        throw new MojoExecutionException(msg, e);
    }

}
 
开发者ID:bsorrentino,项目名称:maven-confluence-plugin,代码行数:56,代码来源:AbstractBaseConfluenceMojo.java

示例6: activateProxy

import org.apache.maven.settings.Proxy; //导入方法依赖的package包/类
/**
 * Called to install the plugins proxy settings.
 */
protected Object activateProxy()
{
    if ( settings == null )
    {
        return null;
    }
    final Proxy proxy = settings.getActiveProxy();
    if ( proxy == null )
    {
        return null;
    }

    final List<String> properties = new ArrayList<String>();
    final String protocol = proxy.getProtocol();
    final String prefix = isEmpty( protocol ) ? "" : ( protocol + "." );

    final String host = proxy.getHost();
    final String hostProperty = prefix + "proxyHost";
    final String hostValue = isEmpty( host ) ? null : host;
    setProperty( properties, hostProperty, hostValue );
    final int port = proxy.getPort();
    final String portProperty = prefix + "proxyPort";
    final String portValue = ( port == 0 || port == -1 ) ? null : String.valueOf( port );
    setProperty( properties, portProperty, portValue );
    final String username = proxy.getUsername();
    final String userProperty = prefix + "proxyUser";
    final String userValue = isEmpty( username ) ? null : username;
    setProperty( properties, userProperty, userValue );
    final String password = proxy.getPassword();
    final String passwordProperty = prefix + "proxyPassword";
    final String passwordValue = isEmpty( password ) ? null : password;
    setProperty( properties, passwordProperty, passwordValue );
    final String nonProxyHosts = proxy.getNonProxyHosts();
    final String nonProxyHostsProperty = prefix + "nonProxyHosts";
    final String nonProxyHostsValue = isEmpty( nonProxyHosts ) ? null : nonProxyHosts.replace( ',', '|' );
    setProperty( properties, nonProxyHostsProperty, nonProxyHostsValue );
    getLog().debug( "Proxy settings: " + hostProperty + "=" + hostValue + ", " + portProperty + "=" + portValue
        + ", " + userProperty + "=" + userValue + ", " + passwordProperty + "="
        + ( passwordValue == null ? "null" : "<PasswordNotLogged>" ) + ", " + nonProxyHostsProperty + "="
        + nonProxyHostsValue );
    return properties;
}
 
开发者ID:mojohaus,项目名称:xml-maven-plugin,代码行数:46,代码来源:AbstractXmlMojo.java


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