Search in sources :

Example 1 with FileTransport

use of org.gradle.internal.resource.transport.file.FileTransport in project gradle by gradle.

the class RepositoryTransportFactory method createTransport.

public RepositoryTransport createTransport(Set<String> schemes, String name, Collection<Authentication> authentications) {
    validateSchemes(schemes);
    ResourceConnectorFactory connectorFactory = findConnectorFactory(schemes);
    // Ensure resource transport protocol, authentication types and credentials are all compatible
    validateConnectorFactoryCredentials(schemes, connectorFactory, authentications);
    // 2) we don't do progress logging for "downloading"
    if (schemes.equals(Collections.singleton("file"))) {
        return new FileTransport(name, fileRepository, cachedExternalResourceIndex, temporaryFileProvider, timeProvider, cacheLockingManager, producerGuard);
    }
    ResourceConnectorSpecification connectionDetails = new DefaultResourceConnectorSpecification(authentications);
    ExternalResourceConnector resourceConnector = connectorFactory.createResourceConnector(connectionDetails);
    resourceConnector = startParameterResolutionOverride.overrideExternalResourceConnnector(resourceConnector);
    ExternalResourceCachePolicy cachePolicy = new DefaultExternalResourceCachePolicy();
    cachePolicy = startParameterResolutionOverride.overrideExternalResourceCachePolicy(cachePolicy);
    return new ResourceConnectorRepositoryTransport(name, progressLoggerFactory, temporaryFileProvider, cachedExternalResourceIndex, timeProvider, cacheLockingManager, resourceConnector, buildOperationExecutor, cachePolicy, producerGuard, fileRepository);
}
Also used : ResourceConnectorFactory(org.gradle.internal.resource.connector.ResourceConnectorFactory) ExternalResourceConnector(org.gradle.internal.resource.transfer.ExternalResourceConnector) FileTransport(org.gradle.internal.resource.transport.file.FileTransport) ResourceConnectorRepositoryTransport(org.gradle.internal.resource.transport.ResourceConnectorRepositoryTransport) ResourceConnectorSpecification(org.gradle.internal.resource.connector.ResourceConnectorSpecification) DefaultExternalResourceCachePolicy(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultExternalResourceCachePolicy) ExternalResourceCachePolicy(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.ExternalResourceCachePolicy) DefaultExternalResourceCachePolicy(org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultExternalResourceCachePolicy)

Aggregations

DefaultExternalResourceCachePolicy (org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultExternalResourceCachePolicy)1 ExternalResourceCachePolicy (org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.ExternalResourceCachePolicy)1 ResourceConnectorFactory (org.gradle.internal.resource.connector.ResourceConnectorFactory)1 ResourceConnectorSpecification (org.gradle.internal.resource.connector.ResourceConnectorSpecification)1 ExternalResourceConnector (org.gradle.internal.resource.transfer.ExternalResourceConnector)1 ResourceConnectorRepositoryTransport (org.gradle.internal.resource.transport.ResourceConnectorRepositoryTransport)1 FileTransport (org.gradle.internal.resource.transport.file.FileTransport)1