/** * Requests the service to start copying a blob's contents, properties, and metadata to a new blob. * * @param sourceBlob * A <code>CloudPageBlob</code> object that represents the source blob to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudPageBlob sourceBlob) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
/** * Requests the service to start copying a blob's contents, properties, and metadata to a new blob. * * @param sourceBlob * A <code>CloudPageBlob</code> object that represents the source blob to copy. * * @return A <code>String</code> which represents the copy ID associated with the copy operation. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException */ @DoesServiceRequest public final String startCopy(final CloudPageBlob sourceBlob) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* sourceAccessCondition */, null /* destinationAccessCondition */, null /* options */, null /* opContext */); }
final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* premiumBlobTier */, sourceAccessCondition, destinationAccessCondition, options, opContext);
final AccessCondition destinationAccessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException { return this.startCopy(sourceBlob, null /* premiumBlobTier */, sourceAccessCondition, destinationAccessCondition, options, opContext);
/** * @throws StorageException * @throws URISyntaxException * @throws IOException * @throws InterruptedException */ @Test public void testPageBlobNamePlusEncodingTest() throws StorageException, URISyntaxException, IOException, InterruptedException { final int length = 1 * 1024; final CloudPageBlob originalBlob = (CloudPageBlob) BlobTestHelper.uploadNewBlob(this.container, BlobType.PAGE_BLOB, "a+b.txt", length, null); final CloudPageBlob copyBlob = this.container.getPageBlobReference(originalBlob.getName() + "copyed"); copyBlob.startCopy(originalBlob); BlobTestHelper.waitForCopy(copyBlob); copyBlob.downloadAttributes(); }
return this.startCopy(source, premiumBlobTier, sourceAccessCondition, destinationAccessCondition, options, opContext);
return this.startCopy(source, premiumBlobTier, sourceAccessCondition, destinationAccessCondition, options, opContext);
/** * Start copying a blob and then abort * * @throws StorageException * @throws URISyntaxException * @throws IOException * @throws InterruptedException */ @Test public void testCopyFromPageBlobAbortTest() throws StorageException, URISyntaxException, IOException { final int length = 512; CloudPageBlob originalBlob = (CloudPageBlob) BlobTestHelper.uploadNewBlob( this.container, BlobType.PAGE_BLOB, "originalBlob", length, null); CloudPageBlob copyBlob = this.container.getPageBlobReference(originalBlob.getName() + "copyed"); copyBlob.startCopy(originalBlob); try { copyBlob.abortCopy(copyBlob.getProperties().getCopyState().getCopyId()); } catch (StorageException e) { if (!e.getErrorCode().contains("NoPendingCopyOperation")) { throw e; } } }
String copyId = copy.startCopy(BlobTestHelper.defiddler(source)); BlobTestHelper.waitForCopy(copy);
String copyId = copy.startCopy(BlobTestHelper.defiddler(snapshot)); BlobTestHelper.waitForCopy(copy);
String copyId = copy.startCopy(BlobTestHelper.defiddler(source)); BlobTestHelper.waitForCopy(copy);
sasBlob.exists(); String copyId = copySas.startCopy(BlobTestHelper.defiddler(sasBlob)); BlobTestHelper.waitForCopy(copySas);
String copyId = copy.startCopy(TestHelper.defiddler(source.getUri()), PremiumPageBlobTier.P30, null, null, null, null); assertEquals(BlobType.PAGE_BLOB, copy.getProperties().getBlobType()); assertEquals(PremiumPageBlobTier.P30, copy.getProperties().getPremiumPageBlobTier()); String copyId3 = copy3.startCopy(TestHelper.defiddler(source2.getUri()), PremiumPageBlobTier.P60, null ,null ,null, null); assertEquals(BlobType.PAGE_BLOB, copy3.getProperties().getBlobType()); assertEquals(PremiumPageBlobTier.P60, copy3.getProperties().getPremiumPageBlobTier());