/** * Creates a snapshot of the blob. * * @return A <code>CloudBlob</code> object that represents the snapshot of the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final CloudBlob createSnapshot() throws StorageException { return this .createSnapshot(null /* metadata */, null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Creates a snapshot of the blob. * * @return A <code>CloudBlob</code> object that represents the snapshot of the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final CloudBlob createSnapshot() throws StorageException { return this .createSnapshot(null /* metadata */, null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Creates a snapshot of the blob using the specified request options and operation context. * * @param accessCondition * An {@link AccessCondition} object that represents the access conditions for the blob. * @param options * A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying * <code>null</code> will use the default request options from the associated service client ( * {@link CloudBlobClient}). * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * * @return A <code>CloudBlob</code> object that represents the snapshot of the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final CloudBlob createSnapshot(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { return this.createSnapshot(null /* metadata */, accessCondition, options, opContext); }
/** * Creates a snapshot of the blob using the specified request options and operation context. * * @param accessCondition * An {@link AccessCondition} object that represents the access conditions for the blob. * @param options * A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying * <code>null</code> will use the default request options from the associated service client ( * {@link CloudBlobClient}). * @param opContext * An {@link OperationContext} object that represents the context for the current operation. This object * is used to track requests to the storage service, and to provide additional runtime information about * the operation. * * @return A <code>CloudBlob</code> object that represents the snapshot of the blob. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public final CloudBlob createSnapshot(final AccessCondition accessCondition, BlobRequestOptions options, OperationContext opContext) throws StorageException { return this.createSnapshot(null /* metadata */, accessCondition, options, opContext); }
blobSnapshot.createSnapshot(); fail("Expect an IllegalArgumentException from createSnapshot"); } catch (IllegalArgumentException e) {
blobSnapshot.createSnapshot(); fail("Expect an IllegalArgumentException from createSnapshot");
blobSnapshot.createSnapshot(); fail("Expect an IllegalArgumentException from createSnapshot");
@Test @Category({ DevFabricTests.class, DevStoreTests.class }) public void testCloudBlobContainerReferenceFromServerSnapshot() throws StorageException, URISyntaxException, IOException { this.container.create(); CloudBlob blob = BlobTestHelper.uploadNewBlob(this.container, BlobType.BLOCK_BLOB, null, 1024, null); CloudBlob snapshot = blob.createSnapshot(); snapshot.getProperties().setContentType("application/octet-stream"); snapshot.getProperties().setLength(1024); CloudBlob blobRef = this.container.getBlobReferenceFromServer(snapshot.getName(), snapshot.getSnapshotID(), null, null, null); BlobTestHelper.assertAreEqual(snapshot, blobRef); }