diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/BlobContract.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/BlobContract.java index 4e7a4104bbe5c..c471fa9cf6648 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/BlobContract.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/BlobContract.java @@ -145,8 +145,6 @@ GetBlobMetadataResult getBlobMetadata(String container, String blob, GetBlobMeta ListBlobRegionsResult listBlobRegions(String container, String blob, ListBlobRegionsOptions options) throws ServiceException; - SetBlobPropertiesResult setBlobProperties(String container, String blob) throws ServiceException; - SetBlobPropertiesResult setBlobProperties(String container, String blob, SetBlobPropertiesOptions options) throws ServiceException; diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobExceptionProcessor.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobExceptionProcessor.java index 297ba2e8db758..8b64fcd7fddf9 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobExceptionProcessor.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobExceptionProcessor.java @@ -21,6 +21,7 @@ import com.microsoft.windowsazure.services.blob.models.CreateBlobPagesOptions; import com.microsoft.windowsazure.services.blob.models.CreateBlobPagesResult; import com.microsoft.windowsazure.services.blob.models.CreateBlobSnapshotOptions; +import com.microsoft.windowsazure.services.blob.models.CreateBlobSnapshotResult; import com.microsoft.windowsazure.services.blob.models.CreateContainerOptions; import com.microsoft.windowsazure.services.blob.models.DeleteBlobOptions; import com.microsoft.windowsazure.services.blob.models.DeleteContainerOptions; @@ -30,7 +31,6 @@ import com.microsoft.windowsazure.services.blob.models.GetBlobPropertiesOptions; import com.microsoft.windowsazure.services.blob.models.GetBlobPropertiesResult; import com.microsoft.windowsazure.services.blob.models.GetBlobResult; -import com.microsoft.windowsazure.services.blob.models.CreateBlobSnapshotResult; import com.microsoft.windowsazure.services.blob.models.GetContainerACLResult; import com.microsoft.windowsazure.services.blob.models.GetContainerPropertiesResult; import com.microsoft.windowsazure.services.blob.models.GetServicePropertiesResult; @@ -68,6 +68,7 @@ public BlobExceptionProcessor(BlobContract service) { this.service = service; } + @Override public BlobContract withFilter(ServiceFilter filter) { return new BlobExceptionProcessor(service.withFilter(filter)); } @@ -77,6 +78,7 @@ private ServiceException processCatch(ServiceException e) { return ServiceExceptionFactory.process("blob", e); } + @Override public GetServicePropertiesResult getServiceProperties() throws ServiceException { try { return service.getServiceProperties(); @@ -89,6 +91,7 @@ public GetServicePropertiesResult getServiceProperties() throws ServiceException } } + @Override public GetServicePropertiesResult getServiceProperties(BlobServiceOptions options) throws ServiceException { try { return service.getServiceProperties(options); @@ -101,6 +104,7 @@ public GetServicePropertiesResult getServiceProperties(BlobServiceOptions option } } + @Override public void setServiceProperties(ServiceProperties serviceProperties, BlobServiceOptions options) throws ServiceException { try { @@ -114,6 +118,7 @@ public void setServiceProperties(ServiceProperties serviceProperties, BlobServic } } + @Override public void setServiceProperties(ServiceProperties serviceProperties) throws ServiceException { try { service.setServiceProperties(serviceProperties); @@ -126,6 +131,7 @@ public void setServiceProperties(ServiceProperties serviceProperties) throws Ser } } + @Override public ListContainersResult listContainers() throws ServiceException { try { return service.listContainers(); @@ -138,6 +144,7 @@ public ListContainersResult listContainers() throws ServiceException { } } + @Override public ListContainersResult listContainers(ListContainersOptions options) throws ServiceException { try { return service.listContainers(options); @@ -150,6 +157,7 @@ public ListContainersResult listContainers(ListContainersOptions options) throws } } + @Override public void createContainer(String container) throws ServiceException { try { service.createContainer(container); @@ -162,6 +170,7 @@ public void createContainer(String container) throws ServiceException { } } + @Override public void createContainer(String container, CreateContainerOptions options) throws ServiceException { try { service.createContainer(container, options); @@ -174,6 +183,7 @@ public void createContainer(String container, CreateContainerOptions options) th } } + @Override public void deleteContainer(String container) throws ServiceException { try { service.deleteContainer(container); @@ -186,6 +196,7 @@ public void deleteContainer(String container) throws ServiceException { } } + @Override public void deleteContainer(String container, DeleteContainerOptions options) throws ServiceException { try { service.deleteContainer(container, options); @@ -198,6 +209,7 @@ public void deleteContainer(String container, DeleteContainerOptions options) th } } + @Override public GetContainerPropertiesResult getContainerProperties(String container) throws ServiceException { try { return service.getContainerProperties(container); @@ -210,6 +222,7 @@ public GetContainerPropertiesResult getContainerProperties(String container) thr } } + @Override public GetContainerPropertiesResult getContainerProperties(String container, BlobServiceOptions options) throws ServiceException { try { @@ -223,6 +236,7 @@ public GetContainerPropertiesResult getContainerProperties(String container, Blo } } + @Override public GetContainerPropertiesResult getContainerMetadata(String container) throws ServiceException { try { return service.getContainerMetadata(container); @@ -235,6 +249,7 @@ public GetContainerPropertiesResult getContainerMetadata(String container) throw } } + @Override public GetContainerPropertiesResult getContainerMetadata(String container, BlobServiceOptions options) throws ServiceException { try { @@ -248,6 +263,7 @@ public GetContainerPropertiesResult getContainerMetadata(String container, BlobS } } + @Override public GetContainerACLResult getContainerACL(String container) throws ServiceException { try { return service.getContainerACL(container); @@ -260,6 +276,7 @@ public GetContainerACLResult getContainerACL(String container) throws ServiceExc } } + @Override public GetContainerACLResult getContainerACL(String container, BlobServiceOptions options) throws ServiceException { try { return service.getContainerACL(container, options); @@ -272,6 +289,7 @@ public GetContainerACLResult getContainerACL(String container, BlobServiceOption } } + @Override public void setContainerACL(String container, ContainerACL acl) throws ServiceException { try { service.setContainerACL(container, acl); @@ -284,6 +302,7 @@ public void setContainerACL(String container, ContainerACL acl) throws ServiceEx } } + @Override public void setContainerACL(String container, ContainerACL acl, BlobServiceOptions options) throws ServiceException { try { service.setContainerACL(container, acl, options); @@ -296,6 +315,7 @@ public void setContainerACL(String container, ContainerACL acl, BlobServiceOptio } } + @Override public void setContainerMetadata(String container, HashMap metadata) throws ServiceException { try { service.setContainerMetadata(container, metadata); @@ -308,6 +328,7 @@ public void setContainerMetadata(String container, HashMap metad } } + @Override public void setContainerMetadata(String container, HashMap metadata, SetContainerMetadataOptions options) throws ServiceException { try { @@ -321,6 +342,7 @@ public void setContainerMetadata(String container, HashMap metad } } + @Override public ListBlobsResult listBlobs(String container) throws ServiceException { try { return service.listBlobs(container); @@ -333,6 +355,7 @@ public ListBlobsResult listBlobs(String container) throws ServiceException { } } + @Override public ListBlobsResult listBlobs(String container, ListBlobsOptions options) throws ServiceException { try { return service.listBlobs(container, options); @@ -345,6 +368,7 @@ public ListBlobsResult listBlobs(String container, ListBlobsOptions options) thr } } + @Override public void createPageBlob(String container, String blob, int length) throws ServiceException { try { service.createPageBlob(container, blob, length); @@ -357,6 +381,7 @@ public void createPageBlob(String container, String blob, int length) throws Ser } } + @Override public void createPageBlob(String container, String blob, int length, CreateBlobOptions options) throws ServiceException { try { @@ -370,6 +395,7 @@ public void createPageBlob(String container, String blob, int length, CreateBlob } } + @Override public void createBlockBlob(String container, String blob, InputStream contentStream) throws ServiceException { try { service.createBlockBlob(container, blob, contentStream); @@ -382,6 +408,7 @@ public void createBlockBlob(String container, String blob, InputStream contentSt } } + @Override public void createBlockBlob(String container, String blob, InputStream contentStream, CreateBlobOptions options) throws ServiceException { try { @@ -395,6 +422,7 @@ public void createBlockBlob(String container, String blob, InputStream contentSt } } + @Override public CreateBlobPagesResult clearBlobPages(String container, String blob, PageRange range) throws ServiceException { try { return service.clearBlobPages(container, blob, range); @@ -407,6 +435,7 @@ public CreateBlobPagesResult clearBlobPages(String container, String blob, PageR } } + @Override public CreateBlobPagesResult clearBlobPages(String container, String blob, PageRange range, CreateBlobPagesOptions options) throws ServiceException { try { @@ -420,6 +449,7 @@ public CreateBlobPagesResult clearBlobPages(String container, String blob, PageR } } + @Override public CreateBlobPagesResult createBlobPages(String container, String blob, PageRange range, long length, InputStream contentStream) throws ServiceException { try { @@ -433,6 +463,7 @@ public CreateBlobPagesResult createBlobPages(String container, String blob, Page } } + @Override public CreateBlobPagesResult createBlobPages(String container, String blob, PageRange range, long length, InputStream contentStream, CreateBlobPagesOptions options) throws ServiceException { try { @@ -446,6 +477,7 @@ public CreateBlobPagesResult createBlobPages(String container, String blob, Page } } + @Override public void createBlobBlock(String container, String blob, String blockId, InputStream contentStream) throws ServiceException { try { @@ -459,6 +491,7 @@ public void createBlobBlock(String container, String blob, String blockId, Input } } + @Override public void createBlobBlock(String container, String blob, String blockId, InputStream contentStream, CreateBlobBlockOptions options) throws ServiceException { try { @@ -472,6 +505,7 @@ public void createBlobBlock(String container, String blob, String blockId, Input } } + @Override public void commitBlobBlocks(String container, String blob, BlockList blockList) throws ServiceException { try { service.commitBlobBlocks(container, blob, blockList); @@ -484,6 +518,7 @@ public void commitBlobBlocks(String container, String blob, BlockList blockList) } } + @Override public void commitBlobBlocks(String container, String blob, BlockList blockList, CommitBlobBlocksOptions options) throws ServiceException { try { @@ -497,6 +532,7 @@ public void commitBlobBlocks(String container, String blob, BlockList blockList, } } + @Override public ListBlobBlocksResult listBlobBlocks(String container, String blob) throws ServiceException { try { return service.listBlobBlocks(container, blob); @@ -509,6 +545,7 @@ public ListBlobBlocksResult listBlobBlocks(String container, String blob) throws } } + @Override public ListBlobBlocksResult listBlobBlocks(String container, String blob, ListBlobBlocksOptions options) throws ServiceException { try { @@ -522,6 +559,7 @@ public ListBlobBlocksResult listBlobBlocks(String container, String blob, ListBl } } + @Override public GetBlobPropertiesResult getBlobProperties(String container, String blob) throws ServiceException { try { return service.getBlobProperties(container, blob); @@ -534,6 +572,7 @@ public GetBlobPropertiesResult getBlobProperties(String container, String blob) } } + @Override public GetBlobPropertiesResult getBlobProperties(String container, String blob, GetBlobPropertiesOptions options) throws ServiceException { try { @@ -547,6 +586,7 @@ public GetBlobPropertiesResult getBlobProperties(String container, String blob, } } + @Override public GetBlobMetadataResult getBlobMetadata(String container, String blob) throws ServiceException { try { return service.getBlobMetadata(container, blob); @@ -559,6 +599,7 @@ public GetBlobMetadataResult getBlobMetadata(String container, String blob) thro } } + @Override public GetBlobMetadataResult getBlobMetadata(String container, String blob, GetBlobMetadataOptions options) throws ServiceException { try { @@ -572,6 +613,7 @@ public GetBlobMetadataResult getBlobMetadata(String container, String blob, GetB } } + @Override public ListBlobRegionsResult listBlobRegions(String container, String blob) throws ServiceException { try { return service.listBlobRegions(container, blob); @@ -584,6 +626,7 @@ public ListBlobRegionsResult listBlobRegions(String container, String blob) thro } } + @Override public ListBlobRegionsResult listBlobRegions(String container, String blob, ListBlobRegionsOptions options) throws ServiceException { try { @@ -597,6 +640,7 @@ public ListBlobRegionsResult listBlobRegions(String container, String blob, List } } + @Override public SetBlobPropertiesResult setBlobProperties(String container, String blob, SetBlobPropertiesOptions options) throws ServiceException { try { @@ -610,18 +654,7 @@ public SetBlobPropertiesResult setBlobProperties(String container, String blob, } } - public SetBlobPropertiesResult setBlobProperties(String container, String blob) throws ServiceException { - try { - return service.setBlobProperties(container, blob); - } - catch (UniformInterfaceException e) { - throw processCatch(new ServiceException(e)); - } - catch (ClientHandlerException e) { - throw processCatch(new ServiceException(e)); - } - } - + @Override public SetBlobMetadataResult setBlobMetadata(String container, String blob, HashMap metadata) throws ServiceException { try { @@ -635,6 +668,7 @@ public SetBlobMetadataResult setBlobMetadata(String container, String blob, Hash } } + @Override public SetBlobMetadataResult setBlobMetadata(String container, String blob, HashMap metadata, SetBlobMetadataOptions options) throws ServiceException { try { @@ -648,6 +682,7 @@ public SetBlobMetadataResult setBlobMetadata(String container, String blob, Hash } } + @Override public GetBlobResult getBlob(String container, String blob) throws ServiceException { try { return service.getBlob(container, blob); @@ -660,6 +695,7 @@ public GetBlobResult getBlob(String container, String blob) throws ServiceExcept } } + @Override public GetBlobResult getBlob(String container, String blob, GetBlobOptions options) throws ServiceException { try { return service.getBlob(container, blob, options); @@ -672,6 +708,7 @@ public GetBlobResult getBlob(String container, String blob, GetBlobOptions optio } } + @Override public void deleteBlob(String container, String blob) throws ServiceException { try { service.deleteBlob(container, blob); @@ -684,6 +721,7 @@ public void deleteBlob(String container, String blob) throws ServiceException { } } + @Override public void deleteBlob(String container, String blob, DeleteBlobOptions options) throws ServiceException { try { service.deleteBlob(container, blob, options); @@ -696,6 +734,7 @@ public void deleteBlob(String container, String blob, DeleteBlobOptions options) } } + @Override public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob) throws ServiceException { try { return service.createBlobSnapshot(container, blob); @@ -708,6 +747,7 @@ public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob } } + @Override public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob, CreateBlobSnapshotOptions options) throws ServiceException { try { @@ -721,6 +761,7 @@ public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob } } + @Override public void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob) throws ServiceException { try { @@ -734,6 +775,7 @@ public void copyBlob(String destinationContainer, String destinationBlob, String } } + @Override public void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob, CopyBlobOptions options) throws ServiceException { try { @@ -747,6 +789,7 @@ public void copyBlob(String destinationContainer, String destinationBlob, String } } + @Override public AcquireLeaseResult acquireLease(String container, String blob) throws ServiceException { try { return service.acquireLease(container, blob); @@ -759,6 +802,7 @@ public AcquireLeaseResult acquireLease(String container, String blob) throws Ser } } + @Override public AcquireLeaseResult acquireLease(String container, String blob, AcquireLeaseOptions options) throws ServiceException { try { @@ -772,6 +816,7 @@ public AcquireLeaseResult acquireLease(String container, String blob, AcquireLea } } + @Override public AcquireLeaseResult renewLease(String container, String blob, String leaseId) throws ServiceException { try { return service.renewLease(container, blob, leaseId); @@ -784,6 +829,7 @@ public AcquireLeaseResult renewLease(String container, String blob, String lease } } + @Override public AcquireLeaseResult renewLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { try { @@ -797,6 +843,7 @@ public AcquireLeaseResult renewLease(String container, String blob, String lease } } + @Override public void releaseLease(String container, String blob, String leaseId) throws ServiceException { try { service.releaseLease(container, blob, leaseId); @@ -809,6 +856,7 @@ public void releaseLease(String container, String blob, String leaseId) throws S } } + @Override public void releaseLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { try { @@ -822,6 +870,7 @@ public void releaseLease(String container, String blob, String leaseId, BlobServ } } + @Override public void breakLease(String container, String blob, String leaseId) throws ServiceException { try { service.breakLease(container, blob, leaseId); @@ -834,6 +883,7 @@ public void breakLease(String container, String blob, String leaseId) throws Ser } } + @Override public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { try { diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobRestProxy.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobRestProxy.java index a555550a34d65..446a98ebfb7a4 100644 --- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobRestProxy.java +++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/blob/implementation/BlobRestProxy.java @@ -97,6 +97,7 @@ public BlobRestProxy(HttpURLConnectionClient client, ServiceFilter[] filters, St this.dateMapper = dateMapper; } + @Override public BlobContract withFilter(ServiceFilter filter) { ServiceFilter[] newFilters = Arrays.copyOf(filters, filters.length + 1); newFilters[filters.length] = filter; @@ -238,10 +239,12 @@ private String getCopyBlobSourceName(String sourceContainer, String sourceBlob, return sourceName; } + @Override public GetServicePropertiesResult getServiceProperties() throws ServiceException { return getServiceProperties(new BlobServiceOptions()); } + @Override public GetServicePropertiesResult getServiceProperties(BlobServiceOptions options) throws ServiceException { WebResource webResource = getResource(options).path("/").queryParam("resType", "service") .queryParam("comp", "properties"); @@ -253,10 +256,12 @@ public GetServicePropertiesResult getServiceProperties(BlobServiceOptions option return result; } + @Override public void setServiceProperties(ServiceProperties serviceProperties) throws ServiceException { setServiceProperties(serviceProperties, new BlobServiceOptions()); } + @Override public void setServiceProperties(ServiceProperties serviceProperties, BlobServiceOptions options) throws ServiceException { WebResource webResource = getResource(options).path("/").queryParam("resType", "service") @@ -267,10 +272,12 @@ public void setServiceProperties(ServiceProperties serviceProperties, BlobServic builder.put(serviceProperties); } + @Override public void createContainer(String container) throws ServiceException { createContainer(container, new CreateContainerOptions()); } + @Override public void createContainer(String container, CreateContainerOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("resType", "container"); @@ -281,10 +288,12 @@ public void createContainer(String container, CreateContainerOptions options) th builder.put(); } + @Override public void deleteContainer(String container) throws ServiceException { deleteContainer(container, new DeleteContainerOptions()); } + @Override public void deleteContainer(String container, DeleteContainerOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("resType", "container"); @@ -294,19 +303,23 @@ public void deleteContainer(String container, DeleteContainerOptions options) th builder.delete(); } + @Override public GetContainerPropertiesResult getContainerProperties(String container) throws ServiceException { return getContainerProperties(container, new BlobServiceOptions()); } + @Override public GetContainerPropertiesResult getContainerProperties(String container, BlobServiceOptions options) throws ServiceException { return getContainerPropertiesImpl(container, options, null); } + @Override public GetContainerPropertiesResult getContainerMetadata(String container) throws ServiceException { return getContainerMetadata(container, new BlobServiceOptions()); } + @Override public GetContainerPropertiesResult getContainerMetadata(String container, BlobServiceOptions options) throws ServiceException { return getContainerPropertiesImpl(container, options, "metadata"); @@ -330,10 +343,12 @@ private GetContainerPropertiesResult getContainerPropertiesImpl(String container return properties; } + @Override public GetContainerACLResult getContainerACL(String container) throws ServiceException { return getContainerACL(container, new BlobServiceOptions()); } + @Override public GetContainerACLResult getContainerACL(String container, BlobServiceOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("resType", "container") .queryParam("comp", "acl"); @@ -363,10 +378,12 @@ else if ("blob".equals(response.getHeaders().getFirst("x-ms-blob-public-access") return result; } + @Override public void setContainerACL(String container, ContainerACL acl) throws ServiceException { setContainerACL(container, acl, new BlobServiceOptions()); } + @Override public void setContainerACL(String container, ContainerACL acl, BlobServiceOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("resType", "container") .queryParam("comp", "acl"); @@ -385,10 +402,12 @@ else if (acl.getPublicAccess() == PublicAccessType.CONTAINER_AND_BLOBS) { builder.put(si); } + @Override public void setContainerMetadata(String container, HashMap metadata) throws ServiceException { setContainerMetadata(container, metadata, new SetContainerMetadataOptions()); } + @Override public void setContainerMetadata(String container, HashMap metadata, SetContainerMetadataOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("resType", "container") @@ -401,10 +420,12 @@ public void setContainerMetadata(String container, HashMap metad builder.put(); } + @Override public ListContainersResult listContainers() throws ServiceException { return listContainers(new ListContainersOptions()); } + @Override public ListContainersResult listContainers(ListContainersOptions options) throws ServiceException { WebResource webResource = getResource(options).path("/").queryParam("comp", "list"); webResource = addOptionalQueryParam(webResource, "prefix", options.getPrefix()); @@ -417,10 +438,12 @@ public ListContainersResult listContainers(ListContainersOptions options) throws return builder.get(ListContainersResult.class); } + @Override public ListBlobsResult listBlobs(String container) throws ServiceException { return listBlobs(container, new ListBlobsOptions()); } + @Override public ListBlobsResult listBlobs(String container, ListBlobsOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).queryParam("comp", "list") .queryParam("resType", "container"); @@ -435,10 +458,12 @@ public ListBlobsResult listBlobs(String container, ListBlobsOptions options) thr return builder.get(ListBlobsResult.class); } + @Override public void createPageBlob(String container, String blob, int length) throws ServiceException { createPageBlob(container, blob, length, new CreateBlobOptions()); } + @Override public void createPageBlob(String container, String blob, int length, CreateBlobOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container + "/" + blob); @@ -453,10 +478,12 @@ public void createPageBlob(String container, String blob, int length, CreateBlob builder.put(); } + @Override public void createBlockBlob(String container, String blob, InputStream contentStream) throws ServiceException { createBlockBlob(container, blob, contentStream, new CreateBlobOptions()); } + @Override public void createBlockBlob(String container, String blob, InputStream contentStream, CreateBlobOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container + "/" + blob); @@ -470,10 +497,12 @@ public void createBlockBlob(String container, String blob, InputStream contentSt builder.put(contentObject); } + @Override public GetBlobPropertiesResult getBlobProperties(String container, String blob) throws ServiceException { return getBlobProperties(container, blob, new GetBlobPropertiesOptions()); } + @Override public GetBlobPropertiesResult getBlobProperties(String container, String blob, GetBlobPropertiesOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob); @@ -489,10 +518,12 @@ public GetBlobPropertiesResult getBlobProperties(String container, String blob, return getBlobPropertiesResultFromResponse(response); } + @Override public GetBlobMetadataResult getBlobMetadata(String container, String blob) throws ServiceException { return getBlobMetadata(container, blob, new GetBlobMetadataOptions()); } + @Override public GetBlobMetadataResult getBlobMetadata(String container, String blob, GetBlobMetadataOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "metadata"); @@ -513,10 +544,7 @@ public GetBlobMetadataResult getBlobMetadata(String container, String blob, GetB return properties; } - public SetBlobPropertiesResult setBlobProperties(String container, String blob) throws ServiceException { - return setBlobProperties(container, blob, new SetBlobPropertiesOptions()); - } - + @Override public SetBlobPropertiesResult setBlobProperties(String container, String blob, SetBlobPropertiesOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "properties"); @@ -547,11 +575,13 @@ public SetBlobPropertiesResult setBlobProperties(String container, String blob, return result; } + @Override public SetBlobMetadataResult setBlobMetadata(String container, String blob, HashMap metadata) throws ServiceException { return setBlobMetadata(container, blob, metadata, new SetBlobMetadataOptions()); } + @Override public SetBlobMetadataResult setBlobMetadata(String container, String blob, HashMap metadata, SetBlobMetadataOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "metadata"); @@ -570,10 +600,12 @@ public SetBlobMetadataResult setBlobMetadata(String container, String blob, Hash return result; } + @Override public GetBlobResult getBlob(String container, String blob) throws ServiceException { return getBlob(container, blob, new GetBlobOptions()); } + @Override public GetBlobResult getBlob(String container, String blob, GetBlobOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob); webResource = addOptionalQueryParam(webResource, "snapshot", options.getSnapshot()); @@ -594,10 +626,12 @@ public GetBlobResult getBlob(String container, String blob, GetBlobOptions optio return blobResult; } + @Override public void deleteBlob(String container, String blob) throws ServiceException { deleteBlob(container, blob, new DeleteBlobOptions()); } + @Override public void deleteBlob(String container, String blob, DeleteBlobOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container + "/" + blob); webResource = addOptionalQueryParam(webResource, "snapshot", options.getSnapshot()); @@ -611,10 +645,12 @@ public void deleteBlob(String container, String blob, DeleteBlobOptions options) builder.delete(); } + @Override public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob) throws ServiceException { return createBlobSnapshot(container, blob, new CreateBlobSnapshotOptions()); } + @Override public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob, CreateBlobSnapshotOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container + "/" + blob).queryParam("comp", "snapshot"); @@ -635,11 +671,13 @@ public CreateBlobSnapshotResult createBlobSnapshot(String container, String blob return blobSnapshot; } + @Override public void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob) throws ServiceException { copyBlob(destinationContainer, destinationBlob, sourceContainer, sourceBlob, new CopyBlobOptions()); } + @Override public void copyBlob(String destinationContainer, String destinationBlob, String sourceContainer, String sourceBlob, CopyBlobOptions options) { WebResource webResource = getResource(options).path(destinationContainer).path(destinationBlob); @@ -656,37 +694,45 @@ public void copyBlob(String destinationContainer, String destinationBlob, String builder.put(); } + @Override public AcquireLeaseResult acquireLease(String container, String blob) throws ServiceException { return acquireLease(container, blob, new AcquireLeaseOptions()); } + @Override public AcquireLeaseResult acquireLease(String container, String blob, AcquireLeaseOptions options) throws ServiceException { return putLeaseImpl("acquire", container, blob, null/* leaseId */, options, options.getAccessCondition()); } + @Override public AcquireLeaseResult renewLease(String container, String blob, String leaseId) throws ServiceException { return renewLease(container, blob, leaseId, new BlobServiceOptions()); } + @Override public AcquireLeaseResult renewLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { return putLeaseImpl("renew", container, blob, leaseId, options, null/* accessCondition */); } + @Override public void releaseLease(String container, String blob, String leaseId) throws ServiceException { releaseLease(container, blob, leaseId, new BlobServiceOptions()); } + @Override public void releaseLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { putLeaseImpl("release", container, blob, leaseId, options, null/* accessCondition */); } + @Override public void breakLease(String container, String blob, String leaseId) throws ServiceException { breakLease(container, blob, leaseId, new BlobServiceOptions()); } + @Override public void breakLease(String container, String blob, String leaseId, BlobServiceOptions options) throws ServiceException { putLeaseImpl("break", container, blob, leaseId, options, null/* accessCondition */); @@ -710,20 +756,24 @@ private AcquireLeaseResult putLeaseImpl(String leaseAction, String container, St return result; } + @Override public CreateBlobPagesResult clearBlobPages(String container, String blob, PageRange range) throws ServiceException { return clearBlobPages(container, blob, range, new CreateBlobPagesOptions()); } + @Override public CreateBlobPagesResult clearBlobPages(String container, String blob, PageRange range, CreateBlobPagesOptions options) throws ServiceException { return updatePageBlobPagesImpl("clear", container, blob, range, 0, null, options); } + @Override public CreateBlobPagesResult createBlobPages(String container, String blob, PageRange range, long length, InputStream contentStream) throws ServiceException { return createBlobPages(container, blob, range, length, contentStream, new CreateBlobPagesOptions()); } + @Override public CreateBlobPagesResult createBlobPages(String container, String blob, PageRange range, long length, InputStream contentStream, CreateBlobPagesOptions options) throws ServiceException { return updatePageBlobPagesImpl("update", container, blob, range, length, contentStream, options); @@ -754,10 +804,12 @@ private CreateBlobPagesResult updatePageBlobPagesImpl(String action, String cont return result; } + @Override public ListBlobRegionsResult listBlobRegions(String container, String blob) throws ServiceException { return listBlobRegions(container, blob, new ListBlobRegionsOptions()); } + @Override public ListBlobRegionsResult listBlobRegions(String container, String blob, ListBlobRegionsOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "pagelist"); @@ -778,11 +830,13 @@ public ListBlobRegionsResult listBlobRegions(String container, String blob, List return result; } + @Override public void createBlobBlock(String container, String blob, String blockId, InputStream contentStream) throws ServiceException { createBlobBlock(container, blob, blockId, contentStream, new CreateBlobBlockOptions()); } + @Override public void createBlobBlock(String container, String blob, String blockId, InputStream contentStream, CreateBlobBlockOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "block"); @@ -795,10 +849,12 @@ public void createBlobBlock(String container, String blob, String blockId, Input builder.put(contentStream); } + @Override public void commitBlobBlocks(String container, String blob, BlockList blockList) throws ServiceException { commitBlobBlocks(container, blob, blockList, new CommitBlobBlocksOptions()); } + @Override public void commitBlobBlocks(String container, String blob, BlockList blockList, CommitBlobBlocksOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "blocklist"); @@ -816,10 +872,12 @@ public void commitBlobBlocks(String container, String blob, BlockList blockList, builder.put(blockList); } + @Override public ListBlobBlocksResult listBlobBlocks(String container, String blob) throws ServiceException { return listBlobBlocks(container, blob, new ListBlobBlocksOptions()); } + @Override public ListBlobBlocksResult listBlobBlocks(String container, String blob, ListBlobBlocksOptions options) throws ServiceException { WebResource webResource = getResource(options).path(container).path(blob).queryParam("comp", "blocklist");