本文整理汇总了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);
}
}
示例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();
}
示例3: connect
import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Override
public void connect( Repository repository, AuthenticationInfo authenticationInfo,
ProxyInfoProvider proxyInfoProvider )
throws ConnectionException, AuthenticationException
{
}
示例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());
}
}
示例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;
}
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例11: connect
import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
@Override
public final void connect(Repository repository, AuthenticationInfo authenticationInfo) throws ConnectionException, AuthenticationException {
connect(repository);
}
示例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 );
}
示例13: AuthenticationInfoAWSCredentials
import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
AuthenticationInfoAWSCredentials(AuthenticationInfo authenticationInfo) {
this.authenticationInfo = authenticationInfo;
}
示例14: connectToRepository
import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
protected abstract void connectToRepository(Repository repository, AuthenticationInfo authenticationInfo,
ProxyInfoProvider proxyInfoProvider) throws ConnectionException,
AuthenticationException;
示例15: AuthenticationInfoAWSCredentialsProvider
import org.apache.maven.wagon.authentication.AuthenticationInfo; //导入依赖的package包/类
AuthenticationInfoAWSCredentialsProvider(AuthenticationInfo authenticationInfo) {
this.authenticationInfo = authenticationInfo;
}
开发者ID:lambadaframework,项目名称:lambadaframework,代码行数:4,代码来源:AuthenticationInfoAWSCredentialsProvider.java