use of org.gradle.api.artifacts.repositories.PasswordCredentials in project gradle by gradle.
the class SftpConnectorFactory method createResourceConnector.
@Override
public ExternalResourceConnector createResourceConnector(ResourceConnectorSpecification connectionDetails) {
PasswordCredentials passwordCredentials = connectionDetails.getCredentials(PasswordCredentials.class);
SftpResourceAccessor accessor = new SftpResourceAccessor(sftpClientFactory, passwordCredentials);
SftpResourceLister lister = new SftpResourceLister(sftpClientFactory, passwordCredentials);
SftpResourceUploader uploader = new SftpResourceUploader(sftpClientFactory, passwordCredentials);
return new DefaultExternalResourceConnector(accessor, lister, uploader);
}
use of org.gradle.api.artifacts.repositories.PasswordCredentials in project gradle by gradle.
the class S3Client method createConnectionProperties.
private ClientConfiguration createConnectionProperties() {
ClientConfiguration clientConfiguration = new ClientConfiguration();
Optional<HttpProxySettings.HttpProxy> proxyOptional = s3ConnectionProperties.getProxy();
if (proxyOptional.isPresent()) {
HttpProxySettings.HttpProxy proxy = s3ConnectionProperties.getProxy().get();
clientConfiguration.setProxyHost(proxy.host);
clientConfiguration.setProxyPort(proxy.port);
PasswordCredentials credentials = proxy.credentials;
if (credentials != null) {
clientConfiguration.setProxyUsername(credentials.getUsername());
clientConfiguration.setProxyPassword(credentials.getPassword());
}
}
Optional<Integer> maxErrorRetryCount = s3ConnectionProperties.getMaxErrorRetryCount();
if (maxErrorRetryCount.isPresent()) {
clientConfiguration.setMaxErrorRetry(maxErrorRetryCount.get());
}
return clientConfiguration;
}
Aggregations