Search in sources :

Example 1 with DefaultExternalResourceCachePolicy

use of org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultExternalResourceCachePolicy 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)

Example 2 with DefaultExternalResourceCachePolicy

use of org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.DefaultExternalResourceCachePolicy in project gradle by gradle.

the class RepositoryTransportFactory method createTransport.

public RepositoryTransport createTransport(Set<String> schemes, String name, Collection<Authentication> authentications, HttpRedirectVerifier redirectVerifier) {
    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 createFileTransport(name);
    }
    ResourceConnectorSpecification connectionDetails = new DefaultResourceConnectorSpecification(authentications, redirectVerifier);
    ExternalResourceConnector resourceConnector = connectorFactory.createResourceConnector(connectionDetails);
    resourceConnector = startParameterResolutionOverride.overrideExternalResourceConnector(resourceConnector);
    ExternalResourceCachePolicy cachePolicy = new DefaultExternalResourceCachePolicy();
    cachePolicy = startParameterResolutionOverride.overrideExternalResourceCachePolicy(cachePolicy);
    return new ResourceConnectorRepositoryTransport(name, temporaryFileProvider, cachedExternalResourceIndex, timeProvider, artifactCacheLockingManager, resourceConnector, buildOperationExecutor, cachePolicy, producerGuard, fileRepository, checksumService);
}
Also used : ResourceConnectorFactory(org.gradle.internal.resource.connector.ResourceConnectorFactory) ExternalResourceConnector(org.gradle.internal.resource.transfer.ExternalResourceConnector) 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)2 ExternalResourceCachePolicy (org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.ExternalResourceCachePolicy)2 ResourceConnectorFactory (org.gradle.internal.resource.connector.ResourceConnectorFactory)2 ResourceConnectorSpecification (org.gradle.internal.resource.connector.ResourceConnectorSpecification)2 ExternalResourceConnector (org.gradle.internal.resource.transfer.ExternalResourceConnector)2 ResourceConnectorRepositoryTransport (org.gradle.internal.resource.transport.ResourceConnectorRepositoryTransport)2 FileTransport (org.gradle.internal.resource.transport.file.FileTransport)1