public interface BlobContract extends JerseyFilterableService<BlobContract>
BlobContract with one
of the static create methods on BlobService. These methods
associate a Configuration with the implementation, so the
methods on the instance of BlobContract all work with a
particular storage account.| Modifier and Type | Method and Description |
|---|---|
void |
commitBlobBlocks(String container,
String blob,
BlockList blockList)
Commits a list of blocks to a block blob.
|
void |
commitBlobBlocks(String container,
String blob,
BlockList blockList,
CommitBlobBlocksOptions options)
Commits a block list to a block blob, using the specified options.
|
void |
createBlobBlock(String container,
String blob,
String blockId,
InputStream contentStream)
Creates a new uncommited block from a content stream.
|
void |
createBlobBlock(String container,
String blob,
String blockId,
InputStream contentStream,
CreateBlobBlockOptions options)
Creates a new uncommitted block from a content stream, using the
specified options.
|
CreateBlobResult |
createBlockBlob(String container,
String blob,
InputStream contentStream)
Creates a block blob from a content stream.
|
CreateBlobResult |
createBlockBlob(String container,
String blob,
InputStream contentStream,
CreateBlobOptions options)
Creates a block blob from a content stream, using the specified options.
|
void |
createContainer(String container)
Creates a container with the specified name.
|
void |
createContainer(String container,
CreateContainerOptions options)
Creates a container with the specified name, using the specified options.
|
void |
deleteBlob(String container,
String blob)
Marks a blob for deletion.
|
void |
deleteBlob(String container,
String blob,
DeleteBlobOptions options)
Marks a blob or snapshot for deletion, using the specified options.
|
void |
deleteContainer(String container)
Marks a container for deletion.
|
void |
deleteContainer(String container,
DeleteContainerOptions options)
Marks a container for deletion, using the specified options.
|
GetBlobResult |
getBlob(String container,
String blob)
Gets the properties, metadata, and content of a blob.
|
GetBlobResult |
getBlob(String container,
String blob,
GetBlobOptions options)
Gets the properties, metadata, and content of a blob or blob snapshot,
using the specified options.
|
GetBlobPropertiesResult |
getBlobProperties(String container,
String blob)
Gets the properties of a blob.
|
GetBlobPropertiesResult |
getBlobProperties(String container,
String blob,
GetBlobPropertiesOptions options)
Gets the properties of a blob, using the specified options.
|
ListBlobBlocksResult |
listBlobBlocks(String container,
String blob)
Lists the blocks of a blob.
|
ListBlobBlocksResult |
listBlobBlocks(String container,
String blob,
ListBlobBlocksOptions options)
Lists the blocks of a blob, using the specified options.
|
ListContainersResult |
listContainers()
Gets a list of the containers in the blob storage account.
|
ListContainersResult |
listContainers(ListContainersOptions options)
Gets a list of the containers in the blob storage account using the
specified options.
|
withFilterwithRequestFilterFirst, withRequestFilterLast, withResponseFilterFirst, withResponseFilterLastvoid deleteBlob(String container, String blob) throws ServiceException
This method marks the properties, metadata, and content of the blob specified by the blob and container parameters for deletion.
When a blob is successfully deleted, it is immediately removed from the storage account's index and is no longer accessible to clients. The blob's data is later removed from the service during garbage collection.
Note that in order to delete a blob, you must delete all of its
snapshots. You can delete an individual snapshot, only the snapshots, or
both the blob and its snapshots with the
deleteBlob(String, String, DeleteBlobOptions) method.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to delete.ServiceException - if an error occurs accessing the storage service.void deleteBlob(String container, String blob, DeleteBlobOptions options) throws ServiceException
This method marks the properties, metadata, and content of the blob or
snapshot specified by the blob and container parameters
for deletion. Use the options parameter to set
an optional server timeout for the operation, a snapshot timestamp to
specify an individual snapshot to delete, a blob lease ID to delete a
blob with an active lease, a flag indicating whether to delete all
snapshots but not the blob, or both the blob and all snapshots, and any
access conditions to satisfy.
When a blob is successfully deleted, it is immediately removed from the storage account's index and is no longer accessible to clients. The blob's data is later removed from the service during garbage collection.
If the blob has an active lease, the client must specify a valid lease ID in the options parameter in order to delete it.
If a blob has a large number of snapshots, it's possible that the delete blob operation will time out. If this happens, the client should retry the request.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to delete.options - A DeleteBlobOptions instance containing options for
the request.ServiceException - if an error occurs accessing the storage service.ListContainersResult listContainers() throws ServiceException
ListContainersResult reference to the result of the
list containers operation.ServiceException - if an error occurs accessing the storage service.ListContainersResult listContainers(ListContainersOptions options) throws ServiceException
Use the options parameter to specify
options, including a server response timeout for the request, a container
name prefix filter, a marker for continuing requests, the maximum number
of results to return in a request, and whether to include container
metadata in the results.
options - A ListContainersOptions instance containing options
for the request.ListContainersResult reference to the result of the
list containers operation.ServiceException - if an error occurs accessing the storage service.void createContainer(String container) throws ServiceException
Container names must be unique within a storage account, and must follow the naming rules specified in Naming and Referencing Containers, Blobs, and Metadata.
container - A String containing the name of the container to
create.ServiceException - if an error occurs accessing the storage service.void createContainer(String container, CreateContainerOptions options) throws ServiceException
Use the options parameter to specify
options, including a server response timeout for the request, metadata to
set on the container, and the public access level for container and blob
data. Container names must be unique within a storage account, and must
follow the naming rules specified in Naming and Referencing Containers, Blobs, and Metadata.
container - A String containing the name of the container to
create.options - A CreateContainerOptions instance containing options
for the request.ServiceException - if an error occurs accessing the storage service.void deleteContainer(String container) throws ServiceException
When a container is deleted, a container with the same name cannot be created for at least 30 seconds; the container may not be available for more than 30 seconds if the service is still processing the request.
container - A String containing the name of the container to
delete.ServiceException - if an error occurs accessing the storage service.void deleteContainer(String container, DeleteContainerOptions options) throws ServiceException
Use the options parameter to specify the
server response timeout and any access conditions for the container
deletion operation. Access conditions can be used to make the operation
conditional on the value of the Etag or last modified time of the
container.
When a container is deleted, a container with the same name cannot be created for at least 30 seconds; the container may not be available for more than 30 seconds if the service is still processing the request.
container - A String containing the name of the container to
delete.options - A DeleteContainerOptions instance containing options
for the request.ServiceException - if an error occurs accessing the storage service.CreateBlobResult createBlockBlob(String container, String blob, InputStream contentStream) throws ServiceException
container - A String containing the name of the container to
create the blob in.blob - A String containing the name of the blob to create. A
blob name can contain any combination of characters, but
reserved URL characters must be properly escaped. A blob name
must be at least one character long and cannot be more than
1,024 characters long, and must be unique within the
container.contentStream - An InputStream reference to the content stream to
upload to the new blob.ServiceException - if an error occurs accessing the storage service.CreateBlobResult createBlockBlob(String container, String blob, InputStream contentStream, CreateBlobOptions options) throws ServiceException
Use the options parameter to optionally specify
the server timeout for the operation, the MIME content type and content
encoding for the blob, the content language, the MD5 hash, a cache
control value, and blob metadata.
container - A String containing the name of the container to
create the blob in.blob - A String containing the name of the blob to create. A
blob name can contain any combination of characters, but
reserved URL characters must be properly escaped. A blob name
must be at least one character long and cannot be more than
1,024 characters long, and must be unique within the
container.contentStream - An InputStream reference to the content to upload to
the new blob.options - A CreateBlobOptions instance containing options for
the request.ServiceException - if an error occurs accessing the storage service.void createBlobBlock(String container, String blob, String blockId, InputStream contentStream) throws ServiceException
This method creates an uncommitted block for a block blob specified by the blob and container parameters. The blockId parameter is a client-specified ID for the block, which must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified for the blockId parameter must be the same size for each block. The contentStream parameter specifies the content to be copied to the block. The content for the block must be less than or equal to 4 MB in size.
To create or update a block blob, the blocks that have been successfully
written to the server with this method must be committed using a call to
commitBlobBlocks(String, String, BlockList) or
commitBlobBlocks(String, String, BlockList, CommitBlobBlocksOptions).
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to create the
block for.blockId - A String containing a client-specified ID for the
block.contentStream - An InputStream reference to the content to copy to the
block.ServiceException - if an error occurs accessing the storage service.void createBlobBlock(String container, String blob, String blockId, InputStream contentStream, CreateBlobBlockOptions options) throws ServiceException
This method creates an uncommitted block for a block blob specified by
the blob and container parameters. The blockId
parameter is a client-specified ID for the block, which must be less than
or equal to 64 bytes in size. For a given blob, the length of the value
specified for the blockId parameter must be the same size for
each block. The contentStream parameter specifies the content to
be copied to the block. The content for the block must be less than or
equal to 4 MB in size. Use the options
parameter to optionally specify the server timeout for the operation, the
lease ID if the blob has an active lease, and the MD5 hash value for the
block content.
To create or update a block blob, the blocks that have been successfully
written to the server with this method must be committed using a call to
commitBlobBlocks(String, String, BlockList) or
commitBlobBlocks(String, String, BlockList, CommitBlobBlocksOptions).
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to create the
block for.blockId - A String containing a client-specified ID for the
block.contentStream - An InputStream reference to the content to copy to the
block.options - A CreateBlobBlockOptions instance containing options
for the request.ServiceException - if an error occurs accessing the storage service.void commitBlobBlocks(String container, String blob, BlockList blockList) throws ServiceException
This method creates or updates the block blob specified by the blob and container parameters. You can call this method to update a blob by uploading only those blocks that have changed, then committing the new and existing blocks together. You can do this with the blockList parameter by specifying whether to commit a block from the committed block list or from the uncommitted block list, or to commit the most recently uploaded version of the block, whichever list it may belong to.
In order to be written as part of a blob, each block in the list must
have been successfully written to the server with a call to
createBlobBlock(String, String, String, InputStream)
or
createBlobBlock(String, String, String, InputStream, CreateBlobBlockOptions).
container - A String containing the name of the blob's container.blob - A String containing the name of the block blob to
create or update.blockList - A BlockList containing the list of blocks to commit to
the block blob.ServiceException - if an error occurs accessing the storage service.void commitBlobBlocks(String container, String blob, BlockList blockList, CommitBlobBlocksOptions options) throws ServiceException
This method creates or updates the block blob specified by the
blob and container parameters. You can call this method
to update a blob by uploading only those blocks that have changed, then
committing the new and existing blocks together. You can do this with the
blockList parameter by specifying whether to commit a block from
the committed block list or from the uncommitted block list, or to commit
the most recently uploaded version of the block, whichever list it may
belong to. Use the options parameter to
optionally specify the server timeout for the operation, the MIME content
type and content encoding for the blob, the content language, the MD5
hash, a cache control value, blob metadata, the lease ID if the blob has
an active lease, and any access conditions for the operation.
In order to be written as part of a blob, each block in the list must
have been successfully written to the server with a call to
createBlobBlock(String, String, String, InputStream)
or
createBlobBlock(String, String, String, InputStream, CreateBlobBlockOptions).
container - A String containing the name of the blob's container.blob - A String containing the name of the block blob to
create or update.blockList - A BlockList containing the list of blocks to commit to
the block blob.options - A CommitBlobBlocksOptions instance containing options
for the request.ServiceException - if an error occurs accessing the storage service.ListBlobBlocksResult listBlobBlocks(String container, String blob) throws ServiceException
This method lists the committed blocks of the block blob specified by the blob and container parameters.
container - A String containing the name of the blob's container.blob - A String containing the name of the block blob to
list.ListBlobBlocksResult instance containing the list of
blocks returned for the request.ServiceException - if an error occurs accessing the storage service.ListBlobBlocksResult listBlobBlocks(String container, String blob, ListBlobBlocksOptions options) throws ServiceException
This method lists the committed blocks, uncommitted blocks, or both, of
the block blob specified by the blob and container
parameters. Use the options parameter to
specify an optional server timeout for the operation, the lease ID if the
blob has an active lease, the snapshot timestamp to get the committed
blocks of a snapshot, whether to return the committed block list, and
whether to return the uncommitted block list. By default, only the
committed blocks of the blob are returned.
container - A String containing the name of the blob's container.blob - A String containing the name of the block blob to
list.options - A ListBlobBlocksOptions instance containing options
for the request.ListBlobBlocksResult instance containing the list of
blocks returned for the request.ServiceException - if an error occurs accessing the storage service.GetBlobPropertiesResult getBlobProperties(String container, String blob) throws ServiceException
This method lists the properties of the blob specified by the blob and container parameters.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to get
properties for.GetBlobPropertiesResult instance containing the blob
properties returned for the request.ServiceException - if an error occurs accessing the storage service.GetBlobPropertiesResult getBlobProperties(String container, String blob, GetBlobPropertiesOptions options) throws ServiceException
This method lists the properties of the blob specified by the
blob and container parameters. Use the
options parameter to set an optional
server timeout for the operation, the lease ID if the blob has an active
lease, the snapshot timestamp to get the properties of a snapshot, and
any access conditions for the request.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to get
properties for.options - A GetBlobPropertiesOptions instance containing options
for the request.GetBlobPropertiesResult instance containing the blob
properties returned for the request.ServiceException - if an error occurs accessing the storage service.GetBlobResult getBlob(String container, String blob) throws ServiceException
This method gets the properties, metadata, and content of the blob specified by the blob and container parameters.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to get.GetBlobResult instance containing the properties,
metadata, and content of the blob from the server response to the
request.ServiceException - if an error occurs accessing the storage service.GetBlobResult getBlob(String container, String blob, GetBlobOptions options) throws ServiceException
This method gets the properties, metadata, and content of the blob
specified by the blob and container parameters. Use the
options parameter to set an optional server
timeout for the operation, a snapshot timestamp to specify a snapshot, a
blob lease ID to get a blob with an active lease, an optional start and
end range for blob content to return, and any access conditions to
satisfy.
container - A String containing the name of the blob's container.blob - A String containing the name of the blob to get.options - A GetBlobOptions instance containing options for the
request.GetBlobResult instance containing the properties,
metadata, and content of the blob from the server response to the
request.ServiceException - if an error occurs accessing the storage service./**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/