org.eclipse.aether.repository.Proxy.getHost()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(6.2k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中org.eclipse.aether.repository.Proxy.getHost()方法的一些代码示例,展示了Proxy.getHost()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Proxy.getHost()方法的具体详情如下:
包路径:org.eclipse.aether.repository.Proxy
类名称:Proxy
方法名:getHost

Proxy.getHost介绍

[英]Gets the host for this proxy.
[中]获取此代理的主机。

代码示例

代码示例来源:origin: apache/maven

p.setHost( proxy.getHost() );
p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );

代码示例来源:origin: apache/maven

p.setHost( proxy.getHost() );
p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );

代码示例来源:origin: org.eclipse.aether/aether-api

@Override
public String toString()
{
  return getHost() + ':' + getPort();
}

代码示例来源:origin: org.eclipse.aether/aether-transport-http

private static HttpHost toHost( Proxy proxy )
{
  HttpHost host = null;
  if ( proxy != null )
  {
    host = new HttpHost( proxy.getHost(), proxy.getPort() );
  }
  return host;
}

代码示例来源:origin: org.apache.maven.resolver/maven-resolver-api

@Override
public String toString()
{
  return getHost() + ':' + getPort();
}

代码示例来源:origin: takari/takari-local-repository

private String getRepoKey(RepositorySystemSession session, RemoteRepository repository) {
 StringBuilder buffer = new StringBuilder(128);
 Proxy proxy = repository.getProxy();
 if (proxy != null) {
  buffer.append(AuthenticationDigest.forProxy(session, repository)).append('@');
  buffer.append(proxy.getHost()).append(':').append(proxy.getPort()).append('>');
 }
 buffer.append(AuthenticationDigest.forRepository(session, repository)).append('@');
 buffer.append(repository.getContentType()).append('-');
 buffer.append(normalizeRepoUrl(repository.getUrl()));
 return buffer.toString();
}

代码示例来源:origin: org.eclipse.aether/aether-impl

private String getRepoKey( RepositorySystemSession session, RemoteRepository repository )
{
  StringBuilder buffer = new StringBuilder( 128 );
  Proxy proxy = repository.getProxy();
  if ( proxy != null )
  {
    buffer.append( AuthenticationDigest.forProxy( session, repository ) ).append( '@' );
    buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' );
  }
  buffer.append( AuthenticationDigest.forRepository( session, repository ) ).append( '@' );
  buffer.append( repository.getContentType() ).append( '-' );
  buffer.append( repository.getId() ).append( '-' );
  buffer.append( normalizeRepoUrl( repository.getUrl() ) );
  return buffer.toString();
}

代码示例来源:origin: io.takari.aether/takari-local-repository

private String getRepoKey(RepositorySystemSession session, RemoteRepository repository) {
 StringBuilder buffer = new StringBuilder(128);
 Proxy proxy = repository.getProxy();
 if (proxy != null) {
  buffer.append(AuthenticationDigest.forProxy(session, repository)).append('@');
  buffer.append(proxy.getHost()).append(':').append(proxy.getPort()).append('>');
 }
 buffer.append(AuthenticationDigest.forRepository(session, repository)).append('@');
 buffer.append(repository.getContentType()).append('-');
 buffer.append(normalizeRepoUrl(repository.getUrl()));
 return buffer.toString();
}

代码示例来源:origin: org.apache.maven.resolver/maven-resolver-impl

private String getRepoKey( RepositorySystemSession session, RemoteRepository repository )
{
  StringBuilder buffer = new StringBuilder( 128 );
  Proxy proxy = repository.getProxy();
  if ( proxy != null )
  {
    buffer.append( AuthenticationDigest.forProxy( session, repository ) ).append( '@' );
    buffer.append( proxy.getHost() ).append( ':' ).append( proxy.getPort() ).append( '>' );
  }
  buffer.append( AuthenticationDigest.forRepository( session, repository ) ).append( '@' );
  buffer.append( repository.getContentType() ).append( '-' );
  buffer.append( repository.getId() ).append( '-' );
  buffer.append( normalizeRepoUrl( repository.getUrl() ) );
  return buffer.toString();
}

代码示例来源:origin: org.apache.maven.resolver/maven-resolver-impl

if ( proxy != null )
  buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );

代码示例来源:origin: org.eclipse.aether/aether-impl

if ( proxy != null )
  buffer.append( " via " ).append( proxy.getHost() ).append( ':' ).append( proxy.getPort() );

代码示例来源:origin: org.eclipse.aether/aether-util

Authenticator.requestPasswordAuthentication( proxy.getHost(), null, proxy.getPort(), "http",
                       "Credentials for proxy " + proxy, null, url,
                       Authenticator.RequestorType.PROXY );

代码示例来源:origin: org.apache.maven.resolver/maven-resolver-util

Authenticator.requestPasswordAuthentication( proxy.getHost(), null, proxy.getPort(), "http",
                       "Credentials for proxy " + proxy, null, url,
                       Authenticator.RequestorType.PROXY );

代码示例来源:origin: org.eclipse.aether/aether-transport-wagon

prox.setHost( p.getHost() );
prox.setPort( p.getPort() );

代码示例来源:origin: org.eclipse.aether/aether-connector-wagon

prox.setHost( p.getHost() );
prox.setPort( p.getPort() );

代码示例来源:origin: org.kie.soup/kie-soup-maven-integration

@Test
public void testProxies() {
  String oldSettingsXmlPath = System.getProperty( CUSTOM_SETTINGS_PROPERTY );
  try {
    if (oldSettingsXmlPath != null) {
      System.clearProperty( CUSTOM_SETTINGS_PROPERTY );
    }
    MavenSettings.reinitSettingsFromString( SETTINGS_WITH_PROXY );
    Aether aether = Aether.getAether();
    RemoteRepository remoteRepository = new RemoteRepository.Builder( "local", "default", "http://myserver.com" ).build();
    Proxy proxy = aether.getSession().getProxySelector().getProxy( remoteRepository );
    assertEquals("http", proxy.getType());
    assertEquals("localhost", proxy.getHost());
    assertEquals(8888, proxy.getPort());
  } finally {
    if (oldSettingsXmlPath != null) {
      System.setProperty( CUSTOM_SETTINGS_PROPERTY, oldSettingsXmlPath );
    }
    MavenSettings.reinitSettings();
  }
}

代码示例来源:origin: org.springframework.boot.experimental/spring-boot-thin-launcher

private org.apache.maven.repository.Proxy proxy(MavenSettings settings,
    RepositorySystemSession session, RemoteRepository remote,
    ProxySelector proxy) {
  Proxy config = proxy.getProxy(remote);
  if (config == null) {
    return null;
  }
  org.apache.maven.repository.Proxy result = new org.apache.maven.repository.Proxy();
  result.setHost(config.getHost());
  if (config.getAuthentication() != null) {
    org.apache.maven.artifact.repository.Authentication auth = authentication(
        settings, session,
        new RemoteRepository.Builder(remote)
            .setAuthentication(config.getAuthentication()).build(),
        config.getAuthentication());
    result.setUserName(auth.getUsername());
    result.setPassword(auth.getPassword() != null ? auth.getPassword()
        : auth.getPassphrase());
  }
  result.setProtocol(config.getType());
  result.setPort(config.getPort());
  return result;
}

代码示例来源:origin: io.takari.aether/aether-connector-okhttp

proxy.setHost(repository.getProxy().getHost());
proxy.setPort(repository.getProxy().getPort());

相关文章