本文整理了Java中org.eclipse.aether.repository.Proxy.getAuthentication()
方法的一些代码示例,展示了Proxy.getAuthentication()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Proxy.getAuthentication()
方法的具体详情如下:
包路径:org.eclipse.aether.repository.Proxy
类名称:Proxy
方法名:getAuthentication
[英]Gets the authentication to use for the proxy connection.
[中]获取用于代理连接的身份验证。
代码示例来源:origin: apache/maven
p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );
if ( proxy.getAuthentication() != null )
代码示例来源:origin: apache/maven
p.setProtocol( proxy.getType() );
p.setPort( proxy.getPort() );
if ( proxy.getAuthentication() != null )
代码示例来源:origin: org.eclipse.aether/aether-api
/**
* Gets an authentication context for the proxy of the specified repository.
*
* @param session The repository system session during which the repository is accessed, must not be {@code null}.
* @param repository The repository for whose proxy to create an authentication context, must not be {@code null}.
* @return An authentication context for the proxy or {@code null} if no proxy is set or no authentication is
* configured for it.
*/
public static AuthenticationContext forProxy( RepositorySystemSession session, RemoteRepository repository )
{
Proxy proxy = repository.getProxy();
return newInstance( session, repository, proxy, ( proxy != null ) ? proxy.getAuthentication() : null );
}
代码示例来源:origin: org.apache.maven.resolver/maven-resolver-api
/**
* Gets an authentication context for the proxy of the specified repository.
*
* @param session The repository system session during which the repository is accessed, must not be {@code null}.
* @param repository The repository for whose proxy to create an authentication context, must not be {@code null}.
* @return An authentication context for the proxy or {@code null} if no proxy is set or no authentication is
* configured for it.
*/
public static AuthenticationContext forProxy( RepositorySystemSession session, RemoteRepository repository )
{
Proxy proxy = repository.getProxy();
return newInstance( session, repository, proxy, ( proxy != null ) ? proxy.getAuthentication() : null );
}
代码示例来源:origin: org.apache.maven.resolver/maven-resolver-impl
auth = proxy.getAuthentication();
if ( auth != null )
代码示例来源:origin: org.eclipse.aether/aether-impl
auth = proxy.getAuthentication();
if ( auth != null )
代码示例来源:origin: org.apache.maven.resolver/maven-resolver-api
/**
* Gets the fingerprint for the authentication of the specified repository's proxy.
*
* @param session The repository system session during which the fingerprint is requested, must not be {@code null}.
* @param repository The repository whose proxy authentication is to be fingerprinted, must not be {@code null}.
* @return The fingerprint of the proxy authentication or an empty string if no proxy is present or if no proxy
* authentication is configured, never {@code null}.
*/
public static String forProxy( RepositorySystemSession session, RemoteRepository repository )
{
String digest = "";
Proxy proxy = repository.getProxy();
if ( proxy != null )
{
Authentication auth = proxy.getAuthentication();
if ( auth != null )
{
AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, proxy );
auth.digest( authDigest );
digest = authDigest.digest();
}
}
return digest;
}
代码示例来源:origin: org.eclipse.aether/aether-api
/**
* Gets the fingerprint for the authentication of the specified repository's proxy.
*
* @param session The repository system session during which the fingerprint is requested, must not be {@code null}.
* @param repository The repository whose proxy authentication is to be fingerprinted, must not be {@code null}.
* @return The fingerprint of the proxy authentication or an empty string if no proxy is present or if no proxy
* authentication is configured, never {@code null}.
*/
public static String forProxy( RepositorySystemSession session, RemoteRepository repository )
{
String digest = "";
Proxy proxy = repository.getProxy();
if ( proxy != null )
{
Authentication auth = proxy.getAuthentication();
if ( auth != null )
{
AuthenticationDigest authDigest = new AuthenticationDigest( session, repository, proxy );
auth.digest( authDigest );
digest = authDigest.digest();
}
}
return digest;
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!