/** * Requests the service to start copying a URI's contents, properties, and metadata to a new blob. * * @param source * A <code>java.net.URI</code> The source URI. URIs for resources outside of Azure * may only be copied into block blobs. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final String startCopy(final URI source) throws StorageException { return this.startCopy(source, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying a URI's contents, properties, and metadata to a new blob. * * @param source * A <code>java.net.URI</code> The source URI. URIs for resources outside of Azure * may only be copied into block blobs. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final String startCopy(final URI source) throws StorageException { return this.startCopy(source, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { return this.startCopy(source, null /* premiumPageBlobTier */, sourceAccessCondition, destinationAccessCondition, options, opContext);
final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { return startCopy(source, null /* contentMd5 */, false /* syncCopy */, premiumPageBlobTier, sourceAccessCondition, destinationAccessCondition, options, opContext);
final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { return this.startCopy(source,null /* premiumPageBlobTier */, sourceAccessCondition, destinationAccessCondition, options, opContext);
dest.startCopy(source.getUri());
@Override public void startCopyFromBlob(CloudBlobWrapper sourceBlob, BlobRequestOptions options, OperationContext opContext, boolean overwriteDestination) throws StorageException, URISyntaxException { AccessCondition dstAccessCondition = overwriteDestination ? null : AccessCondition.generateIfNotExistsCondition(); getBlob().startCopy(sourceBlob.getBlob().getQualifiedUri(), null, dstAccessCondition, options, opContext); }
@Override public void startCopyFromBlob(CloudBlobWrapper sourceBlob, BlobRequestOptions options, OperationContext opContext, boolean overwriteDestination) throws StorageException, URISyntaxException { AccessCondition dstAccessCondition = overwriteDestination ? null : AccessCondition.generateIfNotExistsCondition(); getBlob().startCopy(sourceBlob.getBlob().getQualifiedUri(), null, dstAccessCondition, options, opContext); }
@Override public Path copy(final Path source, final Path copy, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { try { final CloudBlob target = session.getClient().getContainerReference(containerService.getContainer(copy).getName()) .getAppendBlobReference(containerService.getKey(copy)); final CloudBlob blob = session.getClient().getContainerReference(containerService.getContainer(source).getName()) .getBlobReferenceFromServer(containerService.getKey(source)); final BlobRequestOptions options = new BlobRequestOptions(); options.setStoreBlobContentMD5(PreferencesFactory.get().getBoolean("azure.upload.md5")); final URI s = session.getHost().getCredentials().isTokenAuthentication() ? URI.create(blob.getUri().toString() + session.getHost().getCredentials().getToken()) : blob.getUri(); final String id = target.startCopy(s, AccessCondition.generateEmptyCondition(), AccessCondition.generateEmptyCondition(), options, context); if(log.isDebugEnabled()) { log.debug(String.format("Started copy for %s with copy operation ID %s", copy, id)); } // Copy original file attributes return new Path(copy.getParent(), copy.getName(), copy.getType(), new PathAttributes(source.attributes())); } catch(StorageException e) { throw new AzureExceptionMappingService().map("Cannot copy {0}", e, source); } catch(URISyntaxException e) { throw new NotfoundException(e.getMessage(), e); } }