/** * Returns a reference to a {@link CloudAppendBlob} object that represents an append blob in the container, using the * specified snapshot ID. * * @param blobName * A <code>String</code> that represents the name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot ID of the blob. * * @return A {@link CloudAppendBlob} object that represents a reference to the specified append blob. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID) throws URISyntaxException, StorageException { return new CloudAppendBlob(blobName, snapshotID, this); }
/** * Returns a reference to a {@link CloudAppendBlob} object that represents an append blob in the container, using the * specified snapshot ID. * * @param blobName * A <code>String</code> that represents the name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot ID of the blob. * * @return A {@link CloudAppendBlob} object that represents a reference to the specified append blob. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID) throws URISyntaxException, StorageException { return new CloudAppendBlob(blobName, snapshotID, this); }
public static CloudAppendBlob createAppendBlobClient(BlobServiceConfiguration cfg) throws Exception { CloudAppendBlob client = (CloudAppendBlob) getConfiguredClient(cfg); if (client == null) { URI uri = prepareStorageBlobUri(cfg); StorageCredentials creds = getAccountCredentials(cfg); client = new CloudAppendBlob(uri, creds); } return client; }
/** * Returns a reference to a {@link CloudAppendBlob} object that represents an append blob in the directory, using the * specified snapshot ID. * * @param blobName * A <code>String</code> that represents the name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot ID of the blob. * * @return A {@link CloudAppendBlob} object that represents a reference to the specified append blob. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID) throws URISyntaxException, StorageException { Utility.assertNotNullOrEmpty("blobName", blobName); return new CloudAppendBlob(this.getPrefix().concat(blobName), snapshotID, this.getContainer()); }
/** * Returns a reference to a {@link CloudAppendBlob} object that represents an append blob in the directory, using the * specified snapshot ID. * * @param blobName * A <code>String</code> that represents the name of the blob. * @param snapshotID * A <code>String</code> that represents the snapshot ID of the blob. * * @return A {@link CloudAppendBlob} object that represents a reference to the specified append blob. * * @throws StorageException * If a storage service error occurred. * @throws URISyntaxException * If the resource URI is invalid. */ public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID) throws URISyntaxException, StorageException { Utility.assertNotNullOrEmpty("blobName", blobName); return new CloudAppendBlob(this.getPrefix().concat(blobName), snapshotID, this.getContainer()); }
public static CloudAppendBlob defiddler(CloudAppendBlob blob) throws URISyntaxException, StorageException { URI oldUri = blob.getUri(); URI newUri = defiddler(oldUri); if (newUri != oldUri) { CloudAppendBlob newBlob = new CloudAppendBlob(newUri, blob.getServiceClient().getCredentials()); newBlob.setSnapshotID(blob.snapshotID); return newBlob; } else { return blob; } }
public static CloudBlob getBlobReference(BlobType type, StorageCredentials credentials, URI uri) throws StorageException, URISyntaxException { CloudBlob blob = null; switch (type) { case APPEND_BLOB: blob = new CloudAppendBlob(credentials.transformUri(uri)); break; case BLOCK_BLOB: blob = new CloudBlockBlob(credentials.transformUri(uri)); break; case PAGE_BLOB: blob = new CloudPageBlob(credentials.transformUri(uri)); break; case UNSPECIFIED: fail(); } return blob; }
@Override public CloudBlob preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } CloudBlob snapshot = null; final String snapshotTime = BlobResponse.getSnapshotTime(this.getConnection()); if (blob instanceof CloudBlockBlob) { snapshot = new CloudBlockBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } else if (blob instanceof CloudPageBlob) { snapshot = new CloudPageBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } else if (blob instanceof CloudAppendBlob) { snapshot = new CloudAppendBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } snapshot.setProperties(blob.properties); // use the specified metadata if not null : otherwise blob's metadata snapshot.setMetadata(metadata != null ? metadata : blob.metadata); snapshot.updateEtagAndLastModifiedFromResponse(this.getConnection()); return snapshot; } };
@Override public CloudBlob preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_CREATED) { this.setNonExceptionedRetryableFailure(true); return null; } CloudBlob snapshot = null; final String snapshotTime = BlobResponse.getSnapshotTime(this.getConnection()); if (blob instanceof CloudBlockBlob) { snapshot = new CloudBlockBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } else if (blob instanceof CloudPageBlob) { snapshot = new CloudPageBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } else if (blob instanceof CloudAppendBlob) { snapshot = new CloudAppendBlob(blob.getName(), snapshotTime, CloudBlob.this.getContainer()); } snapshot.setProperties(blob.properties); // use the specified metadata if not null : otherwise blob's metadata snapshot.setMetadata(metadata != null ? metadata : blob.metadata); snapshot.updateEtagAndLastModifiedFromResponse(this.getConnection()); return snapshot; } };
CloudAppendBlob copySas = new CloudAppendBlob(new URI(copy.getUri().toString() + "?" + sasToken));