CloudBlobDirectory Class
- java.
lang. Object - ListBlobItem
- com.
microsoft. azure. storage. blob. CloudBlobDirectory
- com.
public class CloudBlobDirectory implements ListBlobItem
Represents a virtual directory of blobs, designated by a delimiter character.
Containers, which are encapsulated as CloudBlobContainer objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
Constructor Summary
Constructor | Description |
---|---|
CloudBlobDirectory(final StorageUri uri, final String prefix, final CloudBlobClient client, final CloudBlobContainer container) |
Creates an instance of the class using the specified address, directory parent, and client. |
CloudBlobDirectory(final StorageUri uri, final String prefix, final CloudBlobClient client, final CloudBlobContainer container, final CloudBlobDirectory parent) |
Creates an instance of the class using the specified address, directory parent, and client. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Cloud |
getAppendBlobReference(final String blobName)
Returns a reference to a CloudAppendBlob object that represents an append blob in the directory. |
Cloud |
getAppendBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudAppendBlob object that represents an append blob in the directory, using the specified snapshot ID. |
Cloud |
getBlockBlobReference(final String blobName)
Returns a reference to a CloudBlockBlob object that represents a block blob in this directory. |
Cloud |
getBlockBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudBlockBlob object that represents a block blob in this directory, using the specified snapshot ID. |
Cloud |
getContainer()
Returns the container for this directory. |
Cloud |
getDirectoryReference(String directoryName)
Returns a reference to a virtual blob directory beneath this directory. |
Cloud |
getPageBlobReference(final String blobName)
Returns a reference to a CloudPageBlob object that represents a page blob in the directory. |
Cloud |
getPageBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudPageBlob object that represents a page blob in the directory, using the specified snapshot ID. |
Cloud |
getParent()
Returns the parent directory of this directory. |
String |
getPrefix()
Returns the prefix for this directory. |
Cloud |
getServiceClient()
Returns the Blob service client associated with this directory. |
final Storage |
getStorageUri()
Returns the list of URIs for all locations. |
URI |
getUri()
Returns the URI for this directory. |
Iterable<List |
listBlobs()
Returns an enumerable collection of blob items for the directory. |
Iterable<List |
listBlobs(String prefix)
Returns an enumerable collection of blob items whose names begin with the specified prefix for the directory. |
Iterable<List |
listBlobs(String prefix, final boolean useFlatBlobListing, final EnumSet<BlobListingDetails> listingDetails, final BlobRequestOptions options, final OperationContext opContext)
Returns an enumerable collection of blob items whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context. |
Result |
listBlobsSegmented()
Returns a result segment of an enumerable collection of blob items in the directory. |
Result |
listBlobsSegmented(String prefix)
Returns a result segment containing a collection of blob items whose names begin with the specified prefix. |
Result |
listBlobsSegmented(String prefix, final boolean useFlatBlobListing, final EnumSet<BlobListingDetails> listingDetails, final Integer maxResults, final ResultContinuation continuationToken, final BlobRequestOptions options, final OperationContext opContext)
Returns a result segment containing a collection of blob items whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context. |
Constructor Details
CloudBlobDirectory
protected CloudBlobDirectory(final StorageUri uri, final String prefix, final CloudBlobClient client, final CloudBlobContainer container)
Creates an instance of the class using the specified address, directory parent, and client.
Parameters:
String
that represents the blob directory's prefix.
CloudBlobDirectory
protected CloudBlobDirectory(final StorageUri uri, final String prefix, final CloudBlobClient client, final CloudBlobContainer container, final CloudBlobDirectory parent)
Creates an instance of the class using the specified address, directory parent, and client.
Parameters:
String
that represents the blob directory's prefix.
CloudBlobDirectory
object that represents the parent directory, if applicable.
Method Details
getAppendBlobReference
public CloudAppendBlob getAppendBlobReference(final String blobName)
Returns a reference to a CloudAppendBlob object that represents an append blob in the directory.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getAppendBlobReference
public CloudAppendBlob getAppendBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudAppendBlob object that represents an append blob in the directory, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getBlockBlobReference
public CloudBlockBlob getBlockBlobReference(final String blobName)
Returns a reference to a CloudBlockBlob object that represents a block blob in this directory.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getBlockBlobReference
public CloudBlockBlob getBlockBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudBlockBlob object that represents a block blob in this directory, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getContainer
public CloudBlobContainer getContainer()
Returns the container for this directory.
Overrides:
CloudBlobDirectory.getContainer()Returns:
Throws:
getDirectoryReference
public CloudBlobDirectory getDirectoryReference(String directoryName)
Returns a reference to a virtual blob directory beneath this directory.
Parameters:
String
that represents the name of the virtual subdirectory.
Returns:
CloudBlobDirectory
object that represents a virtual blob directory beneath this directory.Throws:
getPageBlobReference
public CloudPageBlob getPageBlobReference(final String blobName)
Returns a reference to a CloudPageBlob object that represents a page blob in the directory.
Parameters:
String
that represents the name of the blob.
Returns:
Throws:
getPageBlobReference
public CloudPageBlob getPageBlobReference(final String blobName, final String snapshotID)
Returns a reference to a CloudPageBlob object that represents a page blob in the directory, using the specified snapshot ID.
Parameters:
String
that represents the name of the blob.
String
that represents the snapshot ID of the blob.
Returns:
Throws:
getParent
public CloudBlobDirectory getParent()
Returns the parent directory of this directory.
Overrides:
CloudBlobDirectory.getParent()Returns:
Throws:
getPrefix
public String getPrefix()
Returns the prefix for this directory.
Returns:
String
that represents the prefix for this directory.getServiceClient
public CloudBlobClient getServiceClient()
Returns the Blob service client associated with this directory.
Returns:
getStorageUri
public final StorageUri getStorageUri()
Returns the list of URIs for all locations.
Overrides:
CloudBlobDirectory.getStorageUri()Returns:
getUri
public URI getUri()
Returns the URI for this directory.
Overrides:
CloudBlobDirectory.getUri()Returns:
java.net.URI
object that represents the URI for this directory.listBlobs
public Iterable
Returns an enumerable collection of blob items for the directory.
Returns:
Throws:
listBlobs
public Iterable
Returns an enumerable collection of blob items whose names begin with the specified prefix for the directory.
Parameters:
String
that represents the blob name prefix.
Returns:
Throws:
listBlobs
public Iterable
Returns an enumerable collection of blob items whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context.
Parameters:
String
that represents the prefix of the blob name.
true
to indicate that the returned list will be flat; false
to indicate that the returned list will be hierarchical.
java.util.EnumSet
object that contains BlobListingDetails values that indicate whether snapshots, metadata, and/or uncommitted blocks are returned. Committed blocks are always returned.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
listBlobsSegmented
public ResultSegment
Returns a result segment of an enumerable collection of blob items in the directory.
Returns:
Throws:
listBlobsSegmented
public ResultSegment
Returns a result segment containing a collection of blob items whose names begin with the specified prefix.
Parameters:
String
that represents the prefix of the blob name.
Returns:
Throws:
listBlobsSegmented
public ResultSegment
Returns a result segment containing a collection of blob items whose names begin with the specified prefix, using the specified flat or hierarchical option, listing details options, request options, and operation context.
Parameters:
String
that represents the prefix of the blob name.
true
to indicate that the returned list will be flat; false
to indicate that the returned list will be hierarchical.
java.util.EnumSet
object that contains BlobListingDetails values that indicate whether snapshots, metadata, and/or uncommitted blocks are returned. Committed blocks are always returned.
null
will use the default request options from the associated service client ( CloudBlobClient).
Returns:
Throws:
Applies to
Azure SDK for Java