CloudFileClient Class

  • java.lang.Object

public class CloudFileClient extends ServiceClient

Provides a client for accessing the Microsoft Azure File service.

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 Summary

Constructor Description
CloudFileClient(final URI baseUri, StorageCredentials credentials)

Creates an instance of the class using the specified File service endpoint and account credentials.

CloudFileClient(StorageUri storageUri, StorageCredentials credentials)

Creates an instance of the class using the specified File service endpoint and account credentials.

Method Summary

Modifier and Type Method and Description
final FileServiceProperties downloadServiceProperties()

Retrieves the current FileServiceProperties for the given storage service. This encapsulates the CORS configurations.

final FileServiceProperties downloadServiceProperties(FileRequestOptions options, OperationContext opContext)

Retrieves the current FileServiceProperties for the given storage service. This encapsulates the CORS configurations.

FileRequestOptions getDefaultRequestOptions()

Gets the FileRequestOptions that is used for requests associated with this

CloudFileShare getShareReference(final String shareName)

Gets a CloudFileShare object with the specified name.

CloudFileShare getShareReference(final String shareName, String snapshotID)

Gets a CloudFileShare object with the specified name.

boolean isUsePathStyleUris()

Indicates whether path-style URIs are being used.

Iterable<CloudFileShare> listShares()

Returns an enumerable collection of shares for this File service client.

Iterable<CloudFileShare> listShares(final String prefix)

Returns an enumerable collection of shares whose names begin with the specified prefix for this File service client.

Iterable<CloudFileShare> listShares(final String prefix, final EnumSet<ShareListingDetails> detailsIncluded, final FileRequestOptions options, final 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(final 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(final String prefix, final EnumSet<ShareListingDetails> detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, final FileRequestOptions options, final 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 object.

void uploadServiceProperties(final FileServiceProperties properties)

Uploads a new FileServiceProperties configuration to the given storage service. This encapsulates the CORS configurations.

void uploadServiceProperties(final FileServiceProperties properties, FileRequestOptions options, OperationContext opContext)

Uploads a new FileServiceProperties configuration to the given storage service. This encapsulates the CORS configurations.

Inherited Members

Constructor Details

CloudFileClient

public CloudFileClient(final URI baseUri, StorageCredentials credentials)

Creates an instance of the class using the specified File service endpoint and account credentials.

Parameters:

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.

CloudFileClient

public CloudFileClient(StorageUri storageUri, StorageCredentials credentials)

Creates an instance of the class using the specified File service endpoint and account credentials.

Parameters:

storageUri - A StorageUri object that represents the File service endpoint used to create the client.
credentials - A StorageCredentials object that represents the account credentials.

Method Details

downloadServiceProperties

public final FileServiceProperties downloadServiceProperties()

Retrieves the current FileServiceProperties for the given storage service. This encapsulates the CORS configurations.

Returns:

A FileServiceProperties object representing the current configuration of the service.

Throws:

StorageException - If a storage service error occurred.

downloadServiceProperties

public final FileServiceProperties downloadServiceProperties(FileRequestOptions options, OperationContext opContext)

Retrieves the current FileServiceProperties for the given storage service. This encapsulates the CORS configurations.

Parameters:

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.

Returns:

A FileServiceProperties object representing the current configuration of the service.

Throws:

StorageException - If a storage service error occurred.

getDefaultRequestOptions

public FileRequestOptions getDefaultRequestOptions()

Gets the FileRequestOptions that is used for requests associated with this

Returns:

The FileRequestOptions object containing the values used by this CloudFileClient

getShareReference

public CloudFileShare getShareReference(final String shareName)

Gets a CloudFileShare object with the specified name.

Parameters:

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.

Returns:

A reference to a CloudFileShare object.

Throws:

StorageException
URISyntaxException

getShareReference

public CloudFileShare getShareReference(final String shareName, String snapshotID)

Gets a CloudFileShare object with the specified name.

Parameters:

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.

Returns:

A reference to a CloudFileShare object.

Throws:

StorageException
URISyntaxException

isUsePathStyleUris

protected boolean isUsePathStyleUris()

Indicates whether path-style URIs are being used.

Returns:

true if using path-style URIs; otherwise, false.

listShares

public Iterable listShares()

Returns an enumerable collection of shares for this File service client.

Returns:

An enumerable collection of CloudFileShare objects retrieved lazily that represent the shares for this client.

listShares

public Iterable listShares(final String prefix)

Returns an enumerable collection of shares whose names begin with the specified prefix for this File service client.

Parameters:

prefix - A String that represents the share name prefix.

Returns:

An enumerable collection of CloudFileShare objects retrieved lazily that represent the shares for this client whose names begin with the specified prefix.

listShares

public Iterable listShares(final String prefix, final EnumSet detailsIncluded, final FileRequestOptions options, final 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.

Parameters:

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.

Returns:

An enumerable collection of CloudFileShare objects retrieved lazily that represents the shares for this client.

listSharesSegmented

public ResultSegment listSharesSegmented()

Returns a result segment of an enumerable collection of shares for this File service client.

Returns:

A ResultSegment<T> object that contains a segment of the enumerable collection of CloudFileShare objects that represent the shares for this client.

Throws:

StorageException - If a storage service error occurred.

listSharesSegmented

public ResultSegment listSharesSegmented(final String prefix)

Returns a result segment of an enumerable collection of shares whose names begin with the specified prefix for this File service client.

Parameters:

prefix - A String that represents the prefix of the share name.

Returns:

A ResultSegment<T> object that contains a segment of the enumerable collection of CloudFileShare objects that represent the shares whose names begin with the specified prefix.

Throws:

StorageException - If a storage service error occurred.

listSharesSegmented

public ResultSegment listSharesSegmented(final String prefix, final EnumSet detailsIncluded, final Integer maxResults, final ResultContinuation continuationToken, final FileRequestOptions options, final 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.

Parameters:

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.

Returns:

A ResultSegment<T> object that contains a segment of the enumerable collection of CloudFileShare objects that represent the shares for this client.

Throws:

StorageException - If a storage service error occurred.

setDefaultRequestOptions

public void setDefaultRequestOptions(FileRequestOptions defaultRequestOptions)

Sets the FileRequestOptions that is used for any requests associated with this object.

Parameters:

defaultRequestOptions - A FileRequestOptions object which specifies the options to use.

uploadServiceProperties

public void uploadServiceProperties(final FileServiceProperties properties)

Uploads a new FileServiceProperties configuration to the given storage service. This encapsulates the CORS configurations.

Parameters:

properties - A FileServiceProperties object which specifies the service properties to upload.

Throws:

StorageException - If a storage service error occurred.

uploadServiceProperties

public void uploadServiceProperties(final FileServiceProperties properties, FileRequestOptions options, OperationContext opContext)

Uploads a new FileServiceProperties configuration to the given storage service. This encapsulates the CORS configurations.

Parameters:

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.

Throws:

StorageException - If a storage service error occurred.

Applies to