public final class CloudFileClient extends ServiceClient
This class provides a point of access to the File service. The service client encapsulates the base URI for the File service. It also encapsulates the credentials for accessing the storage account.
Constructor and Description |
---|
CloudFileClient(StorageUri storageUri,
StorageCredentials credentials)
Creates an instance of the
CloudFileClient class using the specified File service endpoint and
account credentials. |
CloudFileClient(URI baseUri,
StorageCredentials credentials)
Creates an instance of the
CloudFileClient class using the specified File service endpoint and
account credentials. |
Modifier and Type | Method and Description |
---|---|
FileServiceProperties |
downloadServiceProperties()
Retrieves the current
FileServiceProperties for the given storage service. |
FileServiceProperties |
downloadServiceProperties(FileRequestOptions options,
OperationContext opContext)
Retrieves the current
FileServiceProperties for the given storage service. |
FileRequestOptions |
getDefaultRequestOptions()
Gets the
FileRequestOptions that is used for requests associated with this CloudFileClient |
CloudFileShare |
getShareReference(String shareName)
Gets a
CloudFileShare object with the specified name. |
CloudFileShare |
getShareReference(String shareName,
String snapshotID)
Gets a
CloudFileShare object with the specified name. |
Iterable<CloudFileShare> |
listShares()
Returns an enumerable collection of shares for this File service client.
|
Iterable<CloudFileShare> |
listShares(String prefix)
Returns an enumerable collection of shares whose names begin with the specified prefix for this File service
client.
|
Iterable<CloudFileShare> |
listShares(String prefix,
EnumSet<ShareListingDetails> detailsIncluded,
FileRequestOptions options,
OperationContext opContext)
Returns an enumerable collection of shares whose names begin with the specified prefix for this File
service client, using the specified details settings, request options, and operation context.
|
ResultSegment<CloudFileShare> |
listSharesSegmented()
Returns a result segment of an enumerable collection of shares for this File service client.
|
ResultSegment<CloudFileShare> |
listSharesSegmented(String prefix)
Returns a result segment of an enumerable collection of shares whose names begin with the specified
prefix for this File service client.
|
ResultSegment<CloudFileShare> |
listSharesSegmented(String prefix,
EnumSet<ShareListingDetails> detailsIncluded,
Integer maxResults,
ResultContinuation continuationToken,
FileRequestOptions options,
OperationContext opContext)
Returns a result segment of an enumerable collection of shares whose names begin with the specified
prefix, using the specified listing details options, request options, and operation context.
|
void |
setDefaultRequestOptions(FileRequestOptions defaultRequestOptions)
Sets the
FileRequestOptions that is used for any requests associated with this
CloudFileClient object. |
void |
uploadServiceProperties(FileServiceProperties properties)
Uploads a new
FileServiceProperties configuration to the given storage service. |
void |
uploadServiceProperties(FileServiceProperties properties,
FileRequestOptions options,
OperationContext opContext)
Uploads a new
FileServiceProperties configuration to the given storage service. |
getCredentials, getEndpoint, getStorageUri
public CloudFileClient(URI baseUri, StorageCredentials credentials)
CloudFileClient
class using the specified File service endpoint and
account credentials.baseUri
- A java.net.URI
object that represents the File service endpoint used to create the
client.credentials
- A StorageCredentials
object that represents the account credentials.public CloudFileClient(StorageUri storageUri, StorageCredentials credentials)
CloudFileClient
class using the specified File service endpoint and
account credentials.storageUri
- A StorageUri
object that represents the File service endpoint used to create the
client.credentials
- A StorageCredentials
object that represents the account credentials.public CloudFileShare getShareReference(String shareName) throws URISyntaxException, StorageException
CloudFileShare
object with the specified name.shareName
- The name of the share, which must adhere to share naming rules. The share name should not
include any path separator characters (/).
Share names must be lowercase, between 3-63 characters long and must start with a letter or
number. Share names may contain only letters, numbers, and the dash (-) character.CloudFileShare
object.StorageException
URISyntaxException
public CloudFileShare getShareReference(String shareName, String snapshotID) throws URISyntaxException, StorageException
CloudFileShare
object with the specified name.shareName
- The name of the share, which must adhere to share naming rules. The share name should not
include any path separator characters (/).
Share names must be lowercase, between 3-63 characters long and must start with a letter or
number. Share names may contain only letters, numbers, and the dash (-) character.snapshotID
- A String
that represents the snapshot ID of the share.CloudFileShare
object.StorageException
URISyntaxException
@DoesServiceRequest public Iterable<CloudFileShare> listShares()
CloudFileShare
objects retrieved lazily that represent the
shares for this client.@DoesServiceRequest public Iterable<CloudFileShare> listShares(String prefix)
prefix
- A String
that represents the share name prefix.CloudFileShare
objects retrieved lazily that represent the
shares for this client whose names begin with the specified prefix.@DoesServiceRequest public Iterable<CloudFileShare> listShares(String prefix, EnumSet<ShareListingDetails> detailsIncluded, FileRequestOptions options, OperationContext opContext)
prefix
- A String
that represents the share name prefix.detailsIncluded
- A java.util.EnumSet
object that contains ShareListingDetails
values that indicate
whether share snapshots and/or metadata will be returned.options
- A FileRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client (
CloudFileClient
).opContext
- An 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.CloudFileShare
objects retrieved lazily that represents the
shares for this client.@DoesServiceRequest public ResultSegment<CloudFileShare> listSharesSegmented() throws StorageException
ResultSegment
object that contains a segment of the enumerable collection of
CloudFileShare
objects that represent the shares for this client.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<CloudFileShare> listSharesSegmented(String prefix) throws StorageException
prefix
- A String
that represents the prefix of the share name.ResultSegment
object that contains a segment of the enumerable collection of
CloudFileShare
objects that represent the shares whose names begin with the specified
prefix.StorageException
- If a storage service error occurred.@DoesServiceRequest public ResultSegment<CloudFileShare> listSharesSegmented(String prefix, EnumSet<ShareListingDetails> detailsIncluded, Integer maxResults, ResultContinuation continuationToken, FileRequestOptions options, OperationContext opContext) throws StorageException
prefix
- A String
that represents the prefix of the share name.detailsIncluded
- A java.util.EnumSet
object that contains ShareListingDetails
values that indicate
whether share snapshots and/or metadata will be returned.maxResults
- The maximum number of results to retrieve. If null
or greater
than 5000, the server will return up to 5,000 items. Must be at least 1.continuationToken
- A ResultContinuation
object that represents a continuation token returned
by a previous listing operation.options
- A FileRequestOptions
object that specifies any additional options for
the request. Specifying null
will use the default request options
from the associated service client ( CloudFileClient
).opContext
- An 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.ResultSegment
object that contains a segment of the enumerable collection
of CloudFileShare
objects that represent the shares for this client.StorageException
- If a storage service error occurred.@DoesServiceRequest public final FileServiceProperties downloadServiceProperties() throws StorageException
FileServiceProperties
for the given storage service. This encapsulates
the CORS configurations.FileServiceProperties
object representing the current configuration of the service.StorageException
- If a storage service error occurred.@DoesServiceRequest public final FileServiceProperties downloadServiceProperties(FileRequestOptions options, OperationContext opContext) throws StorageException
FileServiceProperties
for the given storage service. This encapsulates
the CORS configurations.options
- A FileRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudFileClient
).opContext
- An 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.FileServiceProperties
object representing the current configuration of the service.StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadServiceProperties(FileServiceProperties properties) throws StorageException
FileServiceProperties
configuration to the given storage service. This encapsulates
the CORS configurations.properties
- A FileServiceProperties
object which specifies the service properties to upload.StorageException
- If a storage service error occurred.@DoesServiceRequest public void uploadServiceProperties(FileServiceProperties properties, FileRequestOptions options, OperationContext opContext) throws StorageException
FileServiceProperties
configuration to the given storage service. This encapsulates
the CORS configurations.properties
- A FileServiceProperties
object which specifies the service properties to upload.options
- A FileRequestOptions
object that specifies any additional options for the request. Specifying
null
will use the default request options from the associated service client
(CloudFileClient
).opContext
- An 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.StorageException
- If a storage service error occurred.public FileRequestOptions getDefaultRequestOptions()
FileRequestOptions
that is used for requests associated with this CloudFileClient
getDefaultRequestOptions
in class ServiceClient
FileRequestOptions
object containing the values used by this CloudFileClient
public void setDefaultRequestOptions(FileRequestOptions defaultRequestOptions)
FileRequestOptions
that is used for any requests associated with this
CloudFileClient
object.defaultRequestOptions
- A FileRequestOptions
object which specifies the options to use.Copyright © 2018. All Rights Reserved.