Search in sources :

Example 1 with ReadableContent

use of org.gradle.internal.resource.ReadableContent 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 {
        ReadableContent content = new MavenTransferLoggingFileResource(file, resource);
        getDelegate().putRemoteFile(content, 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 : ReadableContent(org.gradle.internal.resource.ReadableContent) FileReadableContent(org.gradle.internal.resource.local.FileReadableContent) Resource(org.apache.maven.wagon.resource.Resource) 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)

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 ReadableContent (org.gradle.internal.resource.ReadableContent)1 FileReadableContent (org.gradle.internal.resource.local.FileReadableContent)1