Search in sources :

Example 1 with LocalResource

use of org.gradle.internal.resource.local.LocalResource in project gradle by gradle.

the class RepositoryTransportDeployWagon method put.

@Override
public final void put(File file, String resourceName) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException {
    Resource resource = new Resource(resourceName);
    this.transferEventSupport.fireTransferInitiated(transferEvent(resource, TRANSFER_INITIATED, REQUEST_PUT));
    try {
        LocalResource localResource = new MavenTransferLoggingFileResource(file, resource);
        getDelegate().putRemoteFile(localResource, resourceName);
    } catch (Exception e) {
        this.transferEventSupport.fireTransferError(transferEvent(resource, e, REQUEST_PUT));
        throw new TransferFailedException(String.format("Could not write to resource '%s'", resourceName), e);
    }
    this.transferEventSupport.fireTransferCompleted(transferEvent(resource, TRANSFER_COMPLETED, REQUEST_PUT));
}
Also used : Resource(org.apache.maven.wagon.resource.Resource) LocalResource(org.gradle.internal.resource.local.LocalResource) FileLocalResource(org.gradle.internal.resource.local.FileLocalResource) TransferFailedException(org.apache.maven.wagon.TransferFailedException) AuthenticationException(org.apache.maven.wagon.authentication.AuthenticationException) ConnectionException(org.apache.maven.wagon.ConnectionException) AuthorizationException(org.apache.maven.wagon.authorization.AuthorizationException) IOException(java.io.IOException) ResourceDoesNotExistException(org.apache.maven.wagon.ResourceDoesNotExistException) GradleException(org.gradle.api.GradleException) TransferFailedException(org.apache.maven.wagon.TransferFailedException) LocalResource(org.gradle.internal.resource.local.LocalResource) FileLocalResource(org.gradle.internal.resource.local.FileLocalResource)

Aggregations

IOException (java.io.IOException)1 ConnectionException (org.apache.maven.wagon.ConnectionException)1 ResourceDoesNotExistException (org.apache.maven.wagon.ResourceDoesNotExistException)1 TransferFailedException (org.apache.maven.wagon.TransferFailedException)1 AuthenticationException (org.apache.maven.wagon.authentication.AuthenticationException)1 AuthorizationException (org.apache.maven.wagon.authorization.AuthorizationException)1 Resource (org.apache.maven.wagon.resource.Resource)1 GradleException (org.gradle.api.GradleException)1 FileLocalResource (org.gradle.internal.resource.local.FileLocalResource)1 LocalResource (org.gradle.internal.resource.local.LocalResource)1