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


Java AuthenticationInfo类代码示例

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


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

示例1: createFetcher

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的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: testConnectWithConfigSessionFactory

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
/**
 * Tests connection with config session factory
 */
@Test
public void testConnectWithConfigSessionFactory() throws Exception {

    final AuthenticationInfo i = new AuthenticationInfo();
    i.setUserName("git");
    try {
        i.setPrivateKey(new File(Thread.currentThread().getContextClassLoader().getResource("github").toURI())
            .getAbsolutePath());
    } catch (URISyntaxException e) {
        throw new AssertionError(e.getMessage());
    }
    i.setPassphrase(System.getenv("SONAR_GITHUB_TOKEN"));

    final JSch jsch = new AgentJschConfigSessionFactory(i).createDefaultJSch(null);
    assertNotNull(jsch);
    final Session session = jsch.getSession("git", "github.com");
    session.connect(2000);
    assertTrue(session.isConnected());
    session.disconnect();

}
 
开发者ID:trajano,项目名称:wagon-git,代码行数:25,代码来源:JSchTest.java

示例3: connect

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Override
public void connect( Repository repository, AuthenticationInfo authenticationInfo,
                     ProxyInfoProvider proxyInfoProvider )
    throws ConnectionException, AuthenticationException
{

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

示例4: connectToRepository

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Override
protected void connectToRepository(Repository repository, AuthenticationInfo authenticationInfo,
                                   ProxyInfoProvider proxyInfoProvider) throws AuthenticationException {
    if (this.amazonS3 == null) {

        ClientConfiguration clientConfiguration = S3Utils.getClientConfiguration(proxyInfoProvider);

        this.bucketName = S3Utils.getBucketName(repository);
        this.baseDirectory = S3Utils.getBaseDirectory(repository);

        this.amazonS3 = new AmazonS3Client(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
        Region region = Region.fromLocationConstraint(this.amazonS3.getBucketLocation(this.bucketName));
        this.amazonS3.setEndpoint(region.getEndpoint());
    }
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:16,代码来源:SimpleStorageServiceWagon.java

示例5: AuthenticationInfoAWSCredentialsProviderChain

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
AuthenticationInfoAWSCredentialsProviderChain(AuthenticationInfo authenticationInfo) {
    super(
            new InstanceProfileCredentialsProvider(),
            new ProfileCredentialsProvider(),
            new EnvironmentVariableCredentialsProvider(),
            new SystemPropertiesCredentialsProvider(),
            new InstanceProfileCredentialsProvider());
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:9,代码来源:AuthenticationInfoAWSCredentialsProviderChain.java

示例6: connect

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Override
public final void connect(Repository source, AuthenticationInfo authenticationInfo,
                          ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException {
    this.repository = source;
    this.sessionListenerSupport.fireSessionOpening();
    try {
        connectToRepository(source, authenticationInfo, proxyInfoProvider);
        this.sessionListenerSupport.fireSessionLoggedIn();
        this.sessionListenerSupport.fireSessionOpened();
    } catch (ConnectionException | AuthenticationException e) {
        this.sessionListenerSupport.fireSessionConnectionRefused();
        throw e;
    }
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:15,代码来源:AbstractWagon.java

示例7: connectRepositoryProxyInfo

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Test
public void connectRepositoryProxyInfo() throws ConnectionException, AuthenticationException {
    this.wagon.connect(this.repository, this.proxyInfo);

    assertEquals(this.repository, this.wagon.getRepository());
    verify(this.sessionListenerSupport).fireSessionOpening();
    verify(this.wagon).connectToRepository(eq(this.repository), (AuthenticationInfo) isNull(),
            any(NullProtectingProxyInfoProvider.class));
    verify(this.sessionListenerSupport).fireSessionLoggedIn();
    verify(this.sessionListenerSupport).fireSessionOpened();
}
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:12,代码来源:AbstractWagonTest.java

示例8: getAuthInfo

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
/**
 * Builds the AuthInfo object.
 */
@Override
protected AuthenticationInfo getAuthInfo() {

    final AuthenticationInfo i = new AuthenticationInfo();
    i.setUserName("git");
    try {
        i.setPrivateKey(new File(Thread.currentThread().getContextClassLoader().getResource("github").toURI())
            .getAbsolutePath());
    } catch (URISyntaxException e) {
        throw new AssertionError(e.getMessage());
    }
    i.setPassphrase(System.getenv("SONAR_GITHUB_TOKEN"));
    return i;
}
 
开发者ID:trajano,项目名称:wagon-git,代码行数:18,代码来源:GitHubPagesWagonTest.java

示例9: authenticationInfo

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
private AuthenticationInfo authenticationInfo( ArtifactRepository repository )
{
    AuthenticationInfo ai = new AuthenticationInfo();
    ai.setUserName( repository.getAuthentication().getUsername() );
    ai.setPassword( repository.getAuthentication().getPassword() );
    return ai;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:DefaultWagonManager.java

示例10: getAuthenticationInfo

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
public AuthenticationInfo getAuthenticationInfo( String id )
{
    MavenSession session = legacySupport.getSession();

    if ( session != null && id != null )
    {
        MavenExecutionRequest request = session.getRequest();

        if ( request != null )
        {
            List<Server> servers = request.getServers();

            if ( servers != null )
            {
                for ( Server server : servers )
                {
                    if ( id.equalsIgnoreCase( server.getId() ) )
                    {
                        SettingsDecryptionResult result =
                            settingsDecrypter.decrypt( new DefaultSettingsDecryptionRequest( server ) );
                        server = result.getServer();

                        AuthenticationInfo authInfo = new AuthenticationInfo();
                        authInfo.setUserName( server.getUsername() );
                        authInfo.setPassword( server.getPassword() );
                        authInfo.setPrivateKey( server.getPrivateKey() );
                        authInfo.setPassphrase( server.getPassphrase() );

                        return authInfo;
                    }
                }
            }
        }
    }

    // empty one to prevent NPE
   return new AuthenticationInfo();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:39,代码来源:DefaultWagonManager.java

示例11: connect

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

示例12: connect

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

示例13: AuthenticationInfoAWSCredentials

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

示例14: connectToRepository

import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
protected abstract void connectToRepository(Repository repository, AuthenticationInfo authenticationInfo,
                                    ProxyInfoProvider proxyInfoProvider) throws ConnectionException,
AuthenticationException;
 
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:4,代码来源:AbstractWagon.java

示例15: AuthenticationInfoAWSCredentialsProvider

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


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