signature:
public class CloudFileDirectory { /** * Creates the directory using the specified options and operation context .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ throws URISyntaxException */
@ DoesServiceRequest public void create ( FileRequestOptions options , OperationContext opContext ) throws StorageException , URISyntaxException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } this . getShare ( ) . assertNoSnapshot ( ) ; opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; ExecutionEngine . executeWithRetry ( this . fileServiceClient , this , createDirectoryImpl ( options ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudFileDirectory { /** * Creates the directory if it does not exist , using the specified request options and operation context .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request .
 * Specifying < code > null < / code > will use the default request options from the associated service client
 * ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return < code > true < / code > if the directory did not already exist and was created ; otherwise , < code > false < / code > .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException */
@ DoesServiceRequest public boolean createIfNotExists ( FileRequestOptions options , OperationContext opContext ) throws StorageException , URISyntaxException { } }

implementation:
options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; this . getShare ( ) . assertNoSnapshot ( ) ; boolean exists = this . exists ( true /* primaryOnly */
, null /* accessCondition */
, options , opContext ) ; if ( exists ) { return false ; } else { try { this . create ( options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_CONFLICT && StorageErrorCodeStrings . RESOURCE_ALREADY_EXISTS . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } }


signature:
public class CloudFileDirectory { /** * Deletes the directory if it exists using the specified request options and operation context .
 * @ param accessCondition
 * An { @ link AccessCondition } object that represents the access conditions for the directory .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return < code > true < / code > if the directory existed and was deleted ; otherwise , < code > false < / code > .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException */
@ DoesServiceRequest public boolean deleteIfExists ( AccessCondition accessCondition , FileRequestOptions options , OperationContext opContext ) throws StorageException , URISyntaxException { } }

implementation:
options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; boolean exists = this . exists ( true /* primaryOnly */
, accessCondition , options , opContext ) ; if ( exists ) { try { this . delete ( accessCondition , options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_NOT_FOUND && StorageErrorCodeStrings . RESOURCE_NOT_FOUND . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } } else { return false ; }


signature:
public class CloudFileDirectory { /** * Returns a value that indicates whether the directory exists , using the specified request options and operation
 * context .
 * @ param accessCondition
 * An { @ link AccessCondition } object that represents the access conditions for the share .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return < code > true < / code > if the directory exists , otherwise < code > false < / code > .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public boolean exists ( final AccessCondition accessCondition , FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: return this . exists ( false , accessCondition , options , opContext ) ;


signature:
public class CloudFileDirectory { /** * Returns an enumerable collection of file and directory items for the directory .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return An enumerable collection of { @ link ListFileItem } objects that represent the file and directory items in
 * this directory .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException
 * If the resource URI is invalid . */
@ DoesServiceRequest public Iterable < ListFileItem > listFilesAndDirectories ( FileRequestOptions options , OperationContext opContext ) { } }

implementation:
return listFilesAndDirectories ( null /* prefix */
, options , opContext ) ;


signature:
public class CloudFileDirectory { /** * Returns an enumerable collection of file and directory items for the directory .
 * @ param prefix
 * A string containing the file or directory name prefix .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return An enumerable collection of { @ link ListFileItem } objects that represent the file and directory items in
 * this directory .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException
 * If the resource URI is invalid . */
@ DoesServiceRequest public Iterable < ListFileItem > listFilesAndDirectories ( String prefix , FileRequestOptions options , OperationContext opContext ) { } }

implementation:
if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; SegmentedStorageRequest segmentedRequest = new SegmentedStorageRequest ( ) ; return new LazySegmentedIterable < CloudFileClient , CloudFileDirectory , ListFileItem > ( this . listFilesAndDirectoriesSegmentedImpl ( prefix , null /* maxResults */
, options , segmentedRequest ) , this . fileServiceClient , this , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudFileDirectory { /** * Returns a result segment of an enumerable collection of files and directories for this File service client .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection of
 * { @ link ListFileItem } objects that represent the files and directories .
 * @ throws StorageException */
@ DoesServiceRequest public ResultSegment < ListFileItem > listFilesAndDirectoriesSegmented ( ) throws StorageException { } }

implementation:
return this . listFilesAndDirectoriesSegmented ( null /* prefix */
, null /* maxResults */
, null /* continuationToken */
, null /* options */
, null /* opContext */
) ;


signature:
public class CloudFileDirectory { /** * Returns a result segment of an enumerable collection of files and directories for this directory , using the
 * specified listing details options , request options , and operation context .
 * @ param maxResults
 * The maximum number of results to retrieve . If < code > null < / code > or greater
 * than 5000 , the server will return up to 5,000 items . Must be at least 1.
 * @ param continuationToken
 * A { @ link ResultContinuation } object that represents a continuation token
 * returned by a previous listing operation .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for
 * the request . Specifying < code > null < / code > will use the default request options
 * from the associated service client ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection of
 * { @ link ListFileItem } objects that represent the files and directories in this directory .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public ResultSegment < ListFileItem > listFilesAndDirectoriesSegmented ( final Integer maxResults , final ResultContinuation continuationToken , FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: return listFilesAndDirectoriesSegmented ( null , maxResults , continuationToken , options , opContext ) ;


signature:
public class CloudFileDirectory { /** * Returns a result segment of an enumerable collection of files and directories for this directory , using the
 * specified listing details options , request options , and operation context .
 * @ param prefix
 * A string containing the file or directory name prefix .
 * @ param maxResults
 * The maximum number of results to retrieve . If < code > null < / code > or greater
 * than 5000 , the server will return up to 5,000 items . Must be at least 1.
 * @ param continuationToken
 * A { @ link ResultContinuation } object that represents a continuation token
 * returned by a previous listing operation .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for
 * the request . Specifying < code > null < / code > will use the default request options
 * from the associated service client ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection of
 * { @ link ListFileItem } objects that represent the files and directories in this directory .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public ResultSegment < ListFileItem > listFilesAndDirectoriesSegmented ( final String prefix , final Integer maxResults , final ResultContinuation continuationToken , FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; Utility . assertContinuationType ( continuationToken , ResultContinuationType . FILE ) ; SegmentedStorageRequest segmentedRequest = new SegmentedStorageRequest ( ) ; segmentedRequest . setToken ( continuationToken ) ; return ExecutionEngine . executeWithRetry ( this . fileServiceClient , this , this . listFilesAndDirectoriesSegmentedImpl ( prefix , maxResults , options , segmentedRequest ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudFileDirectory { /** * Returns a reference to a { @ link CloudFile } object that represents a file in this directory .
 * @ param fileName
 * A < code > String < / code > that represents the name of the file .
 * @ return A { @ link CloudFile } object that represents a reference to the specified file .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException
 * If the resource URI is invalid . */
public CloudFile getFileReference ( final String fileName ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNullOrEmpty ( "fileName" , fileName ) ; StorageUri subdirectoryUri = PathUtility . appendPathToUri ( this . storageUri , fileName ) ; return new CloudFile ( subdirectoryUri , fileName , this . getShare ( ) ) ;


signature:
public class CloudFileDirectory { /** * Returns a reference to a { @ link CloudFileDirectory } object that represents a directory in this directory .
 * @ param itemName
 * A < code > String < / code > that represents the name of the directory .
 * @ return A { @ link CloudFileDirectory } object that represents a reference to the specified directory .
 * @ throws URISyntaxException
 * If the resource URI is invalid .
 * @ throws StorageException */
public CloudFileDirectory getDirectoryReference ( final String itemName ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNullOrEmpty ( "itemName" , itemName ) ; StorageUri subdirectoryUri = PathUtility . appendPathToUri ( this . storageUri , itemName ) ; return new CloudFileDirectory ( subdirectoryUri , itemName , this . getShare ( ) ) ;


signature:
public class CloudFileDirectory { /** * Returns the { @ link CloudFileDirectory } parent directory associated with this directory .
 * @ return An { @ link CloudFileDirectory } object that represents the parent directory associated with the directory .
 * @ throws StorageException
 * @ throws URISyntaxException */
@ Override public CloudFileDirectory getParent ( ) throws URISyntaxException , StorageException { } }

implementation: if ( this . parent == null ) { final String parentName = CloudFile . getParentNameFromURI ( this . getStorageUri ( ) , this . getShare ( ) ) ; if ( parentName != null ) { StorageUri parentURI = PathUtility . appendPathToUri ( this . getShare ( ) . getStorageUri ( ) , parentName ) ; this . parent = new CloudFileDirectory ( parentURI , this . getServiceClient ( ) . getCredentials ( ) ) ; } } return this . parent ;


signature:
public class CloudFileDirectory { /** * Returns the share for this directory .
 * @ return A { @ link CloudFileShare } that represents the share for this directory .
 * @ throws StorageException
 * If a storage service error occurred .
 * @ throws URISyntaxException
 * If the resource URI is invalid . */
@ Override public CloudFileShare getShare ( ) throws StorageException , URISyntaxException { } }

implementation: if ( this . share == null ) { this . share = this . fileServiceClient . getShareReference ( PathUtility . getShareNameFromUri ( this . getUri ( ) , this . fileServiceClient . isUsePathStyleUris ( ) ) ) ; } return this . share ;


signature:
public class QueueRequest { /** * Constructs a web request to clear all the messages in the queue . Sign the
 * web request with a length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection clearMessages ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext ) throws URISyntaxException , IOException , StorageException { } }

implementation: return BaseRequest . delete ( uri , queueOptions , null , opContext ) ;


signature:
public class QueueRequest { /** * Constructs a web request to delete a message from the queue . Sign the web
 * request with a length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param popReceipt
 * A < code > String < / code > that contains the pop receipt value
 * returned from an earlier call to { @ link CloudQueueMessage # getPopReceipt } for the message to
 * delete .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws IOException
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection deleteMessage ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final String popReceipt ) throws URISyntaxException , IOException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( POP_RECEIPT , popReceipt ) ; final HttpURLConnection request = BaseRequest . delete ( uri , queueOptions , builder , opContext ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to download user - defined metadata and the
 * approximate message count for the queue . Sign the web request with a
 * length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection downloadAttributes ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext ) throws IOException , URISyntaxException , StorageException { } }

implementation: UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( Constants . QueryConstants . COMPONENT , METADATA ) ; final HttpURLConnection retConnection = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; retConnection . setRequestMethod ( Constants . HTTP_HEAD ) ; return retConnection ;


signature:
public class QueueRequest { /** * Constructs a web request to return a listing of all queues in this
 * storage account . Sign the web request with a length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the storage account .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param listingContext
 * A { @ link ListingContext } object that specifies parameters for
 * the listing operation , if any . May be < code > null < / code > .
 * @ param detailsIncluded
 * A { @ link QueueListingDetails } object that specifies additional
 * details to return with the listing , if any . May be < code > null < / code > .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection list ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final ListingContext listingContext , final QueueListingDetails detailsIncluded ) throws URISyntaxException , IOException , StorageException { } }

implementation: final UriQueryBuilder builder = BaseRequest . getListUriQueryBuilder ( listingContext ) ; if ( detailsIncluded == QueueListingDetails . ALL || detailsIncluded == QueueListingDetails . METADATA ) { builder . add ( Constants . QueryConstants . INCLUDE , Constants . QueryConstants . METADATA ) ; } final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setRequestMethod ( Constants . HTTP_GET ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to retrieve a specified number of messages from
 * the front of the queue without changing their visibility . Sign the web
 * request with a length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param numberOfMessages
 * A nonzero value that specifies the number of messages to
 * retrieve from the queue , up to a maximum of 32.
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection peekMessages ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final int numberOfMessages ) throws URISyntaxException , IOException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( PEEK_ONLY , "true" ) ; if ( numberOfMessages != 0 ) { builder . add ( NUMBER_OF_MESSAGES , Integer . toString ( numberOfMessages ) ) ; } final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setRequestMethod ( Constants . HTTP_GET ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to add a message to the back of the queue . Write the encoded message request body
 * generated with a call to QueueMessageSerializer # generateMessageRequestBody ( String ) } to the output
 * stream of the request . Sign the web request with the length of the encoded message request body .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param visibilityTimeoutInSeconds
 * Specifies the length of time for the message to be invisible
 * in seconds , starting when it is added to the queue . A value of
 * 0 will make the message visible immediately . The value must be
 * greater than or equal to 0 , and cannot be larger than 7 days .
 * The visibility timeout of a message cannot be set to a value
 * greater than the time - to - live time .
 * @ param timeToLiveInSeconds
 * Specifies the time - to - live interval for the message , in
 * seconds . The maximum time - to - live allowed is 7 days . If this
 * parameter is 0 , the default time - to - live of 7 days is used .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection putMessage ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final int visibilityTimeoutInSeconds , final int timeToLiveInSeconds ) throws IOException , URISyntaxException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; if ( visibilityTimeoutInSeconds != 0 ) { builder . add ( VISIBILITY_TIMEOUT , Integer . toString ( visibilityTimeoutInSeconds ) ) ; } if ( timeToLiveInSeconds != 0 ) { builder . add ( MESSAGE_TTL , Integer . toString ( timeToLiveInSeconds ) ) ; } final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setDoOutput ( true ) ; request . setRequestMethod ( Constants . HTTP_POST ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to retrieve messages from the front of the
 * queue . Sign the web request with a length of - 1L .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param numberOfMessages
 * A nonzero value that specifies the number of messages to
 * retrieve from the queue , up to a maximum of 32.
 * @ param visibilityTimeoutInSeconds
 * Specifies the visibility timeout value in seconds , relative to
 * server time , to make the retrieved messages invisible until
 * the visibility timeout expires . The value must be larger than
 * or equal to 0 , and cannot be larger than 7 days . The
 * visibility timeout of a message can be set to a value later
 * than the expiry time , which will prevent the message from
 * being retrieved again whether it is processed or not .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection retrieveMessages ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final int numberOfMessages , final int visibilityTimeoutInSeconds ) throws URISyntaxException , IOException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; if ( numberOfMessages != 0 ) { builder . add ( NUMBER_OF_MESSAGES , Integer . toString ( numberOfMessages ) ) ; } builder . add ( VISIBILITY_TIMEOUT , Integer . toString ( visibilityTimeoutInSeconds ) ) ; final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setRequestMethod ( "GET" ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to update the visibility timeout of a message in
 * the queue . Optionally updates the message content if a message request
 * body is written to the output stream of the web request . The web request
 * should be signed with the length of the encoded message request body if
 * one is included , or a length of 0 if no message request body is included .
 * @ param uri
 * A < code > URI < / code > object that specifies the absolute URI to
 * the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ param popReceipt
 * A < code > String < / code > that contains the pop receipt value
 * returned from an earlier call to { @ link CloudQueueMessage # getPopReceipt } for the message to
 * update .
 * @ param visibilityTimeoutInSeconds
 * Specifies the new visibility timeout value in seconds ,
 * relative to server time , to make the retrieved messages
 * invisible until the visibility timeout expires . The value must
 * be larger than or equal to 0 , and cannot be larger than 7
 * days . The visibility timeout of a message can be set to a
 * value later than the expiry time , which will prevent the
 * message from being retrieved again whether it is processed or
 * not .
 * @ return An < code > HttpURLConnection < / code > configured for the specified
 * operation .
 * @ throws IOException
 * @ throws URISyntaxException
 * If the URI is not valid .
 * @ throws StorageException
 * If a storage service error occurred during the operation . */
public static HttpURLConnection updateMessage ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext , final String popReceipt , final int visibilityTimeoutInSeconds ) throws URISyntaxException , IOException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( POP_RECEIPT , popReceipt ) ; builder . add ( VISIBILITY_TIMEOUT , Integer . toString ( visibilityTimeoutInSeconds ) ) ; final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setDoOutput ( true ) ; request . setRequestMethod ( Constants . HTTP_PUT ) ; return request ;


signature:
public class QueueRequest { /** * Sets the ACL for the queue . Sign with length of aclBytes .
 * @ param uri
 * The absolute URI to the queue .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ return a HttpURLConnection configured for the operation .
 * @ throws StorageException */
public static HttpURLConnection setAcl ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext ) throws IOException , URISyntaxException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( Constants . QueryConstants . COMPONENT , Constants . QueryConstants . ACL ) ; final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setDoOutput ( true ) ; request . setRequestMethod ( Constants . HTTP_PUT ) ; return request ;


signature:
public class QueueRequest { /** * Constructs a web request to return the ACL for this queue . Sign with no length specified .
 * @ param uri
 * The absolute URI to the container .
 * @ param queueOptions
 * A { @ link QueueRequestOptions } object that specifies execution options such as retry policy and timeout
 * settings for the operation . Specify < code > null < / code > to use the request options specified on the
 * { @ link CloudQueueClient } .
 * @ param opContext
 * An { @ link 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 .
 * @ return a HttpURLConnection configured for the operation .
 * @ throws StorageException */
public static HttpURLConnection getAcl ( final URI uri , final QueueRequestOptions queueOptions , final OperationContext opContext ) throws IOException , URISyntaxException , StorageException { } }

implementation: final UriQueryBuilder builder = new UriQueryBuilder ( ) ; builder . add ( Constants . QueryConstants . COMPONENT , Constants . QueryConstants . ACL ) ; final HttpURLConnection request = BaseRequest . createURLConnection ( uri , queueOptions , builder , opContext ) ; request . setRequestMethod ( Constants . HTTP_GET ) ; return request ;


signature:
public class ServicePropertiesHandler { /** * Parses the { @ link ServiceProperties } from the given XML stream .
 * @ param stream
 * @ throws IOException
 * @ throws SAXException
 * @ throws ParserConfigurationException */
public static ServiceProperties readServicePropertiesFromStream ( final InputStream stream ) throws SAXException , IOException , ParserConfigurationException { } }

implementation: SAXParser saxParser = Utility . getSAXParser ( ) ; ServicePropertiesHandler handler = new ServicePropertiesHandler ( ) ; handler . props . setLogging ( null ) ; handler . props . setHourMetrics ( null ) ; handler . props . setMinuteMetrics ( null ) ; handler . props . setCors ( null ) ; saxParser . parse ( stream , handler ) ; return handler . props ;


signature:
public class ServicePropertiesHandler { /** * Split a delimiter separated string into an ArrayList
 * @ param str
 * the string to split
 * @ param delimiter
 * the character to split on
 * @ return the list of strings */
private static List < String > splitToList ( String str , String delimiter ) { } }

implementation: ArrayList < String > list = new ArrayList < String > ( ) ; StringTokenizer st = new StringTokenizer ( str , delimiter ) ; while ( st . hasMoreElements ( ) ) { list . add ( st . nextToken ( ) ) ; } return list ;


signature:
public class ServicePropertiesHandler { /** * Split a delimiter separated string into a EnumSet of CorsHttpMethods
 * @ param str
 * the string to split
 * @ param delimiter
 * the character to split on
 * @ return the set of CorsHttpMethods */
private static EnumSet < CorsHttpMethods > splitToEnumSet ( String str , String delimiter ) { } }

implementation: EnumSet < CorsHttpMethods > set = EnumSet . noneOf ( CorsHttpMethods . class ) ; StringTokenizer st = new StringTokenizer ( str , delimiter ) ; while ( st . hasMoreElements ( ) ) { set . add ( CorsHttpMethods . valueOf ( st . nextToken ( ) ) ) ; } return set ;


signature:
public class StorageCredentialsAccountAndKey { /** * Sets the name of the access key to be used when signing the request .
 * @ param key
 * A < code > String < / code > that represents the name of the access key to be used when signing the request . */
public synchronized void updateKey ( final byte [ ] key ) { } }

implementation: if ( key == null || key . length == 0 ) { throw new IllegalArgumentException ( SR . INVALID_KEY ) ; } this . key = key ; this . hmacSha256 = null ;


signature:
public class StorageCredentialsAccountAndKey { /** * Gets the HmacSha256 associated with the account key .
 * @ return A < code > MAC < / code > created with the account key .
 * @ throws InvalidKeyException
 * If the key is not a valid storage key . */
public synchronized Mac getHmac256 ( ) throws InvalidKeyException { } }

implementation:
if ( this . hmacSha256 == null ) { // Initializes the HMAC - SHA256 Mac and SecretKey .
try { this . hmacSha256 = Mac . getInstance ( "HmacSHA256" ) ; } catch ( final NoSuchAlgorithmException e ) { throw new IllegalArgumentException ( ) ; } this . hmacSha256 . init ( new SecretKeySpec ( this . key , "HmacSHA256" ) ) ; } return this . hmacSha256 ;


signature:
public class IPRange { /** * Validate that the IP address is IPv4.
 * @ param ipAddress
 * the IP address to validate */
private static void validateIPAddress ( String ipAddress ) { } }

implementation: try { @ SuppressWarnings ( "unused" ) Inet4Address address = ( Inet4Address ) Inet4Address . getByName ( ipAddress ) ; } catch ( Exception ex ) { throw new IllegalArgumentException ( String . format ( SR . INVALID_IP_ADDRESS , ipAddress ) , ex ) ; }


signature:
public class ShareStatsHandler { /** * Constructs a { @ link ShareStats } object from an XML document received from the service .
 * @ param inStream
 * The XMLStreamReader object .
 * @ return
 * A { @ link ShareStats } object containing the properties in the XML document .
 * @ throws SAXException
 * @ throws ParserConfigurationException
 * @ throws IOException */
public static ShareStats readShareStatsFromStream ( final InputStream inStream ) throws ParserConfigurationException , SAXException , IOException { } }

implementation: SAXParser saxParser = Utility . getSAXParser ( ) ; ShareStatsHandler handler = new ShareStatsHandler ( ) ; saxParser . parse ( inStream , handler ) ; return handler . stats ;


signature:
public class RetryPolicy { /** * Determines the time of the last attempt to a storage location and returns a < code > boolean < / code > that specifies
 * if a request that was sent to the secondary location failed with 404.
 * @ param retryContext
 * A { @ link RetryContext } object that indicates the number of retries , last request ' s results , whether
 * the next retry should happen in the primary or secondary location , and specifies the location mode .
 * @ return
 * < code > true < / code > if a request sent to the secondary location fails with 404 ( Not Found ) .
 * < code > false < / code > otherwise . */
protected boolean evaluateLastAttemptAndSecondaryNotFound ( RetryContext retryContext ) { } }

implementation:
Utility . assertNotNull ( "retryContext" , retryContext ) ; // Retry interval of a request to a location must take the time spent sending requests
// to other locations into account . For example , assume a request was sent to the primary
// location first , then to the secondary , and then to the primary again . If it
// was supposed to wait 10 seconds between requests to the primary and the request to
// the secondary took 3 seconds in total , retry interval should only be 7 seconds . This is because ,
// in total , the requests will be 10 seconds apart from the primary locations ' point of view .
// For this calculation , current instance of the retry policy stores the time of the last
// request to a specific location .
if ( retryContext . getLastRequestResult ( ) . getTargetLocation ( ) == StorageLocation . PRIMARY ) { this . lastPrimaryAttempt = retryContext . getLastRequestResult ( ) . getStopDate ( ) ; } else { this . lastSecondaryAttempt = retryContext . getLastRequestResult ( ) . getStopDate ( ) ; } // If a request sent to the secondary location fails with 404 ( Not Found ) , it is possible
// that the the asynchronous geo - replication for the resource has not completed . So , in case of 404 only in the secondary
// location , the failure should still be retried .
return ( retryContext . getLastRequestResult ( ) . getTargetLocation ( ) == StorageLocation . SECONDARY ) && ( retryContext . getLastRequestResult ( ) . getStatusCode ( ) == HttpURLConnection . HTTP_NOT_FOUND ) ;


signature:
public class RetryPolicy { /** * Determines the { @ link RetryInfo } object that indicates whether the next retry will happen in the primary or
 * secondary location , and specifies the location mode .
 * @ param retryContext
 * A { @ link RetryContext } object that indicates the number of retries , last request ' s results , whether
 * the next retry should happen in the primary or secondary location , and specifies the location mode .
 * @ param secondaryNotFound
 * A < code > boolean < / code > representing whether a request sent to the secondary location failed with 404
 * ( Not Found )
 * @ param retryInterval
 * Backoff Interval .
 * @ return
 * A reference to the { @ link RetryInfo } object that indicates whether the next retry will happen in the
 * primary or secondary location , and specifies the location mode . */
protected RetryInfo evaluateRetryInfo ( final RetryContext retryContext , final boolean secondaryNotFound , final long retryInterval ) { } }

implementation:
RetryInfo retryInfo = new RetryInfo ( retryContext ) ; // Moreover , in case of 404 when trying the secondary location , instead of retrying on the
// secondary , further requests should be sent only to the primary location , as it most
// probably has a higher chance of succeeding there .
if ( secondaryNotFound && ( retryContext . getLocationMode ( ) != LocationMode . SECONDARY_ONLY ) ) { retryInfo . setUpdatedLocationMode ( LocationMode . PRIMARY_ONLY ) ; retryInfo . setTargetLocation ( StorageLocation . PRIMARY ) ; } // Now is the time to calculate the exact retry interval . ShouldRetry call above already
// returned back how long two requests to the same location should be apart from each other .
// However , for the reasons explained above , the time spent between the last attempt to
// the target location and current time must be subtracted from the total retry interval
// that ShouldRetry returned .
Date lastAttemptTime = retryInfo . getTargetLocation ( ) == StorageLocation . PRIMARY ? this . lastPrimaryAttempt : this . lastSecondaryAttempt ; if ( lastAttemptTime != null ) { long sinceLastAttempt = ( new Date ( ) . getTime ( ) - lastAttemptTime . getTime ( ) > 0 ) ? new Date ( ) . getTime ( ) - lastAttemptTime . getTime ( ) : 0 ; retryInfo . setRetryInterval ( ( int ) ( retryInterval - sinceLastAttempt ) ) ; } else { retryInfo . setRetryInterval ( 0 ) ; } return retryInfo ;


signature:
public class Base64 { /** * Decodes a given Base64 string into its corresponding byte array .
 * @ param data
 * the Base64 string , as a < code > String < / code > object , to decode
 * @ return the corresponding decoded byte array
 * @ throws IllegalArgumentException
 * If the string is not a valid base64 encoded string */
public static byte [ ] decode ( final String data ) { } }

implementation:
if ( data == null ) { throw new IllegalArgumentException ( SR . STRING_NOT_VALID ) ; } int byteArrayLength = 3 * data . length ( ) / 4 ; if ( data . endsWith ( "==" ) ) { byteArrayLength -= 2 ; } else if ( data . endsWith ( "=" ) ) { byteArrayLength -= 1 ; } final byte [ ] retArray = new byte [ byteArrayLength ] ; int byteDex = 0 ; int charDex = 0 ; for ( ; charDex < data . length ( ) ; charDex += 4 ) { // get 4 chars , convert to 3 bytes
final int char1 = DECODE_64 [ ( byte ) data . charAt ( charDex ) ] ; final int char2 = DECODE_64 [ ( byte ) data . charAt ( charDex + 1 ) ] ; final int char3 = DECODE_64 [ ( byte ) data . charAt ( charDex + 2 ) ] ; final int char4 = DECODE_64 [ ( byte ) data . charAt ( charDex + 3 ) ] ; if ( char1 < 0 || char2 < 0 || char3 == - 1 || char4 == - 1 ) { // invalid character ( - 1 ) , or bad padding ( - 2)
throw new IllegalArgumentException ( SR . STRING_NOT_VALID ) ; } int tVal = char1 << 18 ; tVal += char2 << 12 ; tVal += ( char3 & 0xff ) << 6 ; tVal += char4 & 0xff ; if ( char3 == - 2 ) { // two " = = " pad chars , check bits 12-24
tVal &= 0x00FFF000 ; retArray [ byteDex ++ ] = ( byte ) ( tVal >> 16 & 0xFF ) ; } else if ( char4 == - 2 ) { // one pad char " = " , check bits 6-24.
tVal &= 0x00FFFFC0 ; retArray [ byteDex ++ ] = ( byte ) ( tVal >> 16 & 0xFF ) ; retArray [ byteDex ++ ] = ( byte ) ( tVal >> 8 & 0xFF ) ; } else { // No pads take all 3 bytes , bits 0-24
retArray [ byteDex ++ ] = ( byte ) ( tVal >> 16 & 0xFF ) ; retArray [ byteDex ++ ] = ( byte ) ( tVal >> 8 & 0xFF ) ; retArray [ byteDex ++ ] = ( byte ) ( tVal & 0xFF ) ; } } return retArray ;


signature:
public class Base64 { /** * Encodes a byte array as a Base64 string .
 * @ param data
 * the byte array to encode
 * @ return the Base64 - encoded string , as a < code > String < / code > object */
public static String encode ( final Byte [ ] data ) { } }

implementation:
final StringBuilder builder = new StringBuilder ( ) ; final int dataRemainder = data . length % 3 ; int j = 0 ; int n = 0 ; for ( ; j < data . length ; j += 3 ) { if ( j < data . length - dataRemainder ) { n = ( ( data [ j ] & 0xFF ) << 16 ) + ( ( data [ j + 1 ] & 0xFF ) << 8 ) + ( data [ j + 2 ] & 0xFF ) ; } else { if ( dataRemainder == 1 ) { n = ( data [ j ] & 0xFF ) << 16 ; } else if ( dataRemainder == 2 ) { n = ( ( data [ j ] & 0xFF ) << 16 ) + ( ( data [ j + 1 ] & 0xFF ) << 8 ) ; } } // Left here for readability
// byte char1 = ( byte ) ( ( n > > > 18 ) & 0x3F ) ;
// byte char2 = ( byte ) ( ( n > > > 12 ) & 0x3F ) ;
// byte char3 = ( byte ) ( ( n > > > 6 ) & 0x3F ) ;
// byte char4 = ( byte ) ( n & 0x3F ) ;
builder . append ( BASE_64_CHARS . charAt ( ( byte ) ( ( n >>> 18 ) & 0x3F ) ) ) ; builder . append ( BASE_64_CHARS . charAt ( ( byte ) ( ( n >>> 12 ) & 0x3F ) ) ) ; builder . append ( BASE_64_CHARS . charAt ( ( byte ) ( ( n >>> 6 ) & 0x3F ) ) ) ; builder . append ( BASE_64_CHARS . charAt ( ( byte ) ( n & 0x3F ) ) ) ; } final int bLength = builder . length ( ) ; // append ' = ' to pad
if ( data . length % 3 == 1 ) { builder . replace ( bLength - 2 , bLength , "==" ) ; } else if ( data . length % 3 == 2 ) { builder . replace ( bLength - 1 , bLength , "=" ) ; } return builder . toString ( ) ;


signature:
public class Base64 { /** * Determines whether the given string contains only Base64 characters .
 * @ param data
 * the string , as a < code > String < / code > object , to validate
 * @ return < code > true < / code > if < code > data < / code > is a valid Base64 string , otherwise < code > false < / code > */
public static boolean validateIsBase64String ( final String data ) { } }

implementation:
if ( data == null || data . length ( ) % 4 != 0 ) { return false ; } for ( int m = 0 ; m < data . length ( ) ; m ++ ) { final byte charByte = ( byte ) data . charAt ( m ) ; // pad char detected
if ( DECODE_64 [ charByte ] == - 2 ) { if ( m < data . length ( ) - 2 ) { return false ; } else if ( m == data . length ( ) - 2 && DECODE_64 [ ( byte ) data . charAt ( m + 1 ) ] != - 2 ) { return false ; } } if ( charByte < 0 || DECODE_64 [ charByte ] == - 1 ) { return false ; } } return true ;


signature:
public class NameValidator { /** * Checks if a container name is valid .
 * @ param containerName
 * A String representing the container name to validate . */
public static void validateContainerName ( String containerName ) { } }

implementation: if ( ! ( "$root" . equals ( containerName ) || "$logs" . equals ( containerName ) ) ) { NameValidator . validateShareContainerQueueHelper ( containerName , SR . CONTAINER ) ; }


signature:
public class NameValidator { /** * Checks if a blob name is valid .
 * @ param blobName
 * A String representing the blob name to validate . */
public static void validateBlobName ( String blobName ) { } }

implementation: if ( Utility . isNullOrEmptyOrWhitespace ( blobName ) ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . RESOURCE_NAME_EMPTY , SR . BLOB ) ) ; } if ( blobName . length ( ) < NameValidator . BLOB_FILE_DIRECTORY_MIN_LENGTH || blobName . length ( ) > NameValidator . BLOB_MAX_LENGTH ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . INVALID_RESOURCE_NAME_LENGTH , SR . BLOB , NameValidator . BLOB_FILE_DIRECTORY_MIN_LENGTH , NameValidator . BLOB_MAX_LENGTH ) ) ; } int slashCount = 0 ; for ( int i = 0 ; i < blobName . length ( ) ; i ++ ) { if ( blobName . charAt ( i ) == '/' ) { slashCount ++ ; } } if ( slashCount >= 254 ) { throw new IllegalArgumentException ( SR . TOO_MANY_PATH_SEGMENTS ) ; }


signature:
public class NameValidator { /** * Checks if a file name is valid .
 * @ param fileName
 * A String representing the file name to validate . */
public static void validateFileName ( String fileName ) { } }

implementation: NameValidator . ValidateFileDirectoryHelper ( fileName , SR . FILE ) ; if ( fileName . endsWith ( "/" ) ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . INVALID_RESOURCE_NAME , SR . FILE ) ) ; } for ( String s : NameValidator . RESERVED_FILE_NAMES ) { if ( s . equalsIgnoreCase ( fileName ) ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . INVALID_RESOURCE_RESERVED_NAME , SR . FILE ) ) ; } }


signature:
public class NameValidator { /** * Checks if a table name is valid .
 * @ param tableName
 * A String representing the table name to validate . */
public static void validateTableName ( String tableName ) { } }

implementation: if ( Utility . isNullOrEmptyOrWhitespace ( tableName ) ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . RESOURCE_NAME_EMPTY , SR . TABLE ) ) ; } if ( tableName . length ( ) < NameValidator . CONTAINER_SHARE_QUEUE_TABLE_MIN_LENGTH || tableName . length ( ) > NameValidator . CONTAINER_SHARE_QUEUE_TABLE_MAX_LENGTH ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . INVALID_RESOURCE_NAME_LENGTH , SR . TABLE , NameValidator . CONTAINER_SHARE_QUEUE_TABLE_MIN_LENGTH , NameValidator . CONTAINER_SHARE_QUEUE_TABLE_MAX_LENGTH ) ) ; } if ( ! ( NameValidator . TABLE_REGEX . matcher ( tableName ) . matches ( ) || NameValidator . METRICS_TABLE_REGEX . matcher ( tableName ) . matches ( ) || tableName . equalsIgnoreCase ( "$MetricsCapacityBlob" ) ) ) { throw new IllegalArgumentException ( String . format ( Utility . LOCALE_US , SR . INVALID_RESOURCE_NAME , SR . TABLE ) ) ; }


signature:
public class ShareListHandler { /** * Parses a { @ link ShareListResponse } form the given XML stream .
 * @ param serviceClient
 * a reference to the client object associated with this object .
 * @ param stream
 * the stream from which to parse the share list
 * @ throws SAXException
 * @ throws ParserConfigurationException
 * @ throws IOException */
protected static ListResponse < CloudFileShare > getShareList ( final InputStream stream , final CloudFileClient serviceClient ) throws ParserConfigurationException , SAXException , IOException { } }

implementation: SAXParser saxParser = Utility . getSAXParser ( ) ; ShareListHandler handler = new ShareListHandler ( serviceClient ) ; saxParser . parse ( stream , handler ) ; return handler . response ;


signature:
public class CloudFileClient { /** * Gets a { @ link CloudFileShare } object with the specified name .
 * @ param 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 .
 * @ return A reference to a { @ link CloudFileShare } object .
 * @ throws StorageException
 * @ throws URISyntaxException
 * @ see < a href = " http : / / msdn . microsoft . com / en - us / library / azure / dn167011 . aspx " > Naming and Referencing Shares ,
 * Directories , Files , and Metadata < / a > */
public CloudFileShare getShareReference ( final String shareName ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNullOrEmpty ( "shareName" , shareName ) ; return this . getShareReference ( shareName , null ) ;


signature:
public class CloudFileClient { /** * Gets a { @ link CloudFileShare } object with the specified name .
 * @ param 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 .
 * @ param snapshotID
 * A < code > String < / code > that represents the snapshot ID of the share .
 * @ return A reference to a { @ link CloudFileShare } object .
 * @ throws StorageException
 * @ throws URISyntaxException
 * @ see < a href = " http : / / msdn . microsoft . com / en - us / library / azure / dn167011 . aspx " > Naming and Referencing Shares ,
 * Directories , Files , and Metadata < / a > */
public CloudFileShare getShareReference ( final String shareName , String snapshotID ) throws URISyntaxException , StorageException { } }

implementation: Utility . assertNotNullOrEmpty ( "shareName" , shareName ) ; return new CloudFileShare ( shareName , snapshotID , this ) ;


signature:
public class CloudFileClient { /** * Returns an enumerable collection of shares whose names begin with the specified prefix for this File service
 * client .
 * @ param prefix
 * A < code > String < / code > that represents the share name prefix .
 * @ return An enumerable collection of { @ link CloudFileShare } objects retrieved lazily that represent the
 * shares for this client whose names begin with the specified prefix . */
@ DoesServiceRequest public Iterable < CloudFileShare > listShares ( final String prefix ) { } }

implementation:
return this . listSharesWithPrefix ( prefix , EnumSet . noneOf ( ShareListingDetails . class ) , null /* options */
, null /* opContext */
) ;


signature:
public class CloudFileClient { /** * 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 .
 * @ param prefix
 * A < code > String < / code > that represents the share name prefix .
 * @ param detailsIncluded
 * A < code > java . util . EnumSet < / code > object that contains { @ link ShareListingDetails } values that indicate
 * whether share snapshots and / or metadata will be returned .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return An enumerable collection of { @ link CloudFileShare } objects retrieved lazily that represents the
 * shares for this client . */
@ DoesServiceRequest public Iterable < CloudFileShare > listShares ( final String prefix , final EnumSet < ShareListingDetails > detailsIncluded , final FileRequestOptions options , final OperationContext opContext ) { } }

implementation: return this . listSharesWithPrefix ( prefix , detailsIncluded , options , opContext ) ;


signature:
public class CloudFileClient { /** * Returns a result segment of an enumerable collection of shares for this File service client .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection of
 * { @ link CloudFileShare } objects that represent the shares for this client .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public ResultSegment < CloudFileShare > listSharesSegmented ( ) throws StorageException { } }

implementation:
return this . listSharesSegmented ( null , EnumSet . noneOf ( ShareListingDetails . class ) , null , null /* continuationToken */
, null /* options */
, null /* opContext */
) ;


signature:
public class CloudFileClient { /** * Returns a result segment of an enumerable collection of shares whose names begin with the specified
 * prefix for this File service client .
 * @ param prefix
 * A < code > String < / code > that represents the prefix of the share name .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection of
 * { @ link CloudFileShare } objects that represent the shares whose names begin with the specified
 * prefix .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public ResultSegment < CloudFileShare > listSharesSegmented ( final String prefix ) throws StorageException { } }

implementation:
return this . listSharesWithPrefixSegmented ( prefix , EnumSet . noneOf ( ShareListingDetails . class ) , null , null /* continuationToken */
, null /* options */
, null /* opContext */
) ;


signature:
public class CloudFileClient { /** * 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 .
 * @ param prefix
 * A < code > String < / code > that represents the prefix of the share name .
 * @ param detailsIncluded
 * A < code > java . util . EnumSet < / code > object that contains { @ link ShareListingDetails } values that indicate
 * whether share snapshots and / or metadata will be returned .
 * @ param maxResults
 * The maximum number of results to retrieve . If < code > null < / code > or greater
 * than 5000 , the server will return up to 5,000 items . Must be at least 1.
 * @ param continuationToken
 * A { @ link ResultContinuation } object that represents a continuation token returned
 * by a previous listing operation .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for
 * the request . Specifying < code > null < / code > will use the default request options
 * from the associated service client ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection
 * of { @ link CloudFileShare } objects that represent the shares for this client .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public ResultSegment < CloudFileShare > listSharesSegmented ( final String prefix , final EnumSet < ShareListingDetails > detailsIncluded , final Integer maxResults , final ResultContinuation continuationToken , final FileRequestOptions options , final OperationContext opContext ) throws StorageException { } }

implementation: return this . listSharesWithPrefixSegmented ( prefix , detailsIncluded , maxResults , continuationToken , options , opContext ) ;


signature:
public class CloudFileClient { /** * Returns an enumerable collection of shares whose names begin with the specified prefix , using the
 * specified details settings , request options , and operation context .
 * @ param prefix
 * A < code > String < / code > that represents the prefix of the share name .
 * @ param detailsIncluded
 * A < code > java . util . EnumSet < / code > object that contains { @ link ShareListingDetails } values that indicate
 * whether share snapshots and / or metadata will be returned .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client (
 * { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return An enumerable collection of { @ link CloudFileShare } objects retrieved lazily that represent the
 * shares whose names begin with the specified prefix . */
private Iterable < CloudFileShare > listSharesWithPrefix ( final String prefix , final EnumSet < ShareListingDetails > detailsIncluded , FileRequestOptions options , OperationContext opContext ) { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this ) ; SegmentedStorageRequest segmentedRequest = new SegmentedStorageRequest ( ) ; return new LazySegmentedIterable < CloudFileClient , Void , CloudFileShare > ( this . listSharesWithPrefixSegmentedImpl ( prefix , detailsIncluded , null , options , segmentedRequest ) , this , null , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudFileClient { /** * 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 .
 * @ param prefix
 * A < code > String < / code > that represents the prefix of the share name .
 * @ param detailsIncluded
 * A < code > java . util . EnumSet < / code > object that contains { @ link ShareListingDetails } values that indicate
 * whether share snapshots and / or metadata will be returned .
 * @ param maxResults
 * The maximum number of results to retrieve . If < code > null < / code > or greater
 * than 5000 , the server will return up to 5,000 items . Must be at least 1.
 * @ param continuationToken
 * A { @ link ResultContinuation } object that represents a continuation token returned
 * by a previous listing operation .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for
 * the request . Specifying < code > null < / code > will use the default request options
 * from the associated service client ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return A { @ link ResultSegment } object that contains a segment of the enumerable collection
 * of { @ link CloudFileShare } objects that represent the shares for this client .
 * @ throws StorageException
 * If a storage service error occurred . */
private ResultSegment < CloudFileShare > listSharesWithPrefixSegmented ( final String prefix , final EnumSet < ShareListingDetails > detailsIncluded , final Integer maxResults , final ResultContinuation continuationToken , FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this ) ; Utility . assertContinuationType ( continuationToken , ResultContinuationType . SHARE ) ; SegmentedStorageRequest segmentedRequest = new SegmentedStorageRequest ( ) ; segmentedRequest . setToken ( continuationToken ) ; return ExecutionEngine . executeWithRetry ( this , null , this . listSharesWithPrefixSegmentedImpl ( prefix , detailsIncluded , maxResults , options , segmentedRequest ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class CloudFileClient { /** * Retrieves the current { @ link FileServiceProperties } for the given storage service . This encapsulates
 * the CORS configurations .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client
 * ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 .
 * @ return A { @ link FileServiceProperties } object representing the current configuration of the service .
 * @ throws StorageException
 * If a storage service error occurred . */
@ DoesServiceRequest public final FileServiceProperties downloadServiceProperties ( FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this ) ; return new FileServiceProperties ( ExecutionEngine . executeWithRetry ( this , null , this . downloadServicePropertiesImpl ( options , false ) , options . getRetryPolicyFactory ( ) , opContext ) ) ;


signature:
public class CloudFileClient { /** * Uploads a new { @ link FileServiceProperties } configuration to the given storage service . This encapsulates
 * the CORS configurations .
 * @ param properties
 * A { @ link FileServiceProperties } object which specifies the service properties to upload .
 * @ param options
 * A { @ link FileRequestOptions } object that specifies any additional options for the request . Specifying
 * < code > null < / code > will use the default request options from the associated service client
 * ( { @ link CloudFileClient } ) .
 * @ param opContext
 * An { @ link 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 . */
@ DoesServiceRequest public void uploadServiceProperties ( final FileServiceProperties properties , FileRequestOptions options , OperationContext opContext ) throws StorageException { } }

implementation: if ( opContext == null ) { opContext = new OperationContext ( ) ; } opContext . initialize ( ) ; options = FileRequestOptions . populateAndApplyDefaults ( options , this ) ; Utility . assertNotNull ( "properties" , properties ) ; ExecutionEngine . executeWithRetry ( this , null , this . uploadServicePropertiesImpl ( properties . getServiceProperties ( ) , options , opContext , false ) , options . getRetryPolicyFactory ( ) , opContext ) ;


signature:
public class TableServiceEntity { /** * Deserializes the table entity property map into the specified object instance using reflection .
 * This static method takes an object instance that represents a table entity type and uses reflection on its class
 * type to find methods to deserialize the data from the property map into the instance .
 * Each property name and data type in the properties map is compared with the methods in the class type for a pair
 * of getter and setter methods to use for serialization and deserialization . The class is scanned for methods with
 * names that match the property name with " get " and " set " prepended , or with the { @ link StoreAs } annotation set
 * with the property name . The methods must have return types or parameter data types that match the data type of
 * the corresponding { @ link EntityProperty } value . If such a pair is found , the data is copied into the instance
 * object by invoking the setter method on the instance . Properties that do not match a method pair by name and data
 * type are not copied .
 * @ param instance
 * An < code > Object < / code > reference to an instance of a class implementing { @ link TableEntity } to
 * deserialize the table entity
 * data into .
 * @ param properties
 * A < code > java . util . HashMap < / code > object which maps < code > String < / code > property names to
 * { @ link EntityProperty } objects containing typed data
 * values to deserialize into the instance parameter object .
 * @ param opContext
 * An { @ link OperationContext } object that represents the context for the current operation .
 * @ throws IllegalArgumentException
 * if the table entity response received is invalid or improperly formatted .
 * @ throws IllegalAccessException
 * if the table entity threw an exception during deserialization .
 * @ throws InvocationTargetException
 * if a method invoked on the instance parameter threw an exception during deserialization . */
public static void readEntityWithReflection ( final Object instance , final HashMap < String , EntityProperty > properties , final OperationContext opContext ) throws IllegalArgumentException , IllegalAccessException , InvocationTargetException { } }

implementation: final HashMap < String , PropertyPair > props = PropertyPair . generatePropertyPairs ( instance . getClass ( ) ) ; for ( final Entry < String , EntityProperty > p : properties . entrySet ( ) ) { if ( props . containsKey ( p . getKey ( ) ) ) { props . get ( p . getKey ( ) ) . consumeEntityProperty ( p . getValue ( ) , instance ) ; } }


signature:
public class TableServiceEntity { /** * Serializes the property data from a table entity instance into a property map using reflection .
 * This static method takes an object instance that represents a table entity type and uses reflection on its class
 * type to find methods to serialize the data from the instance into the property map .
 * Each property name and data type in the properties map is compared with the methods in the class type for a pair
 * of getter and setter methods to use for serialization and deserialization . The class is scanned for methods with
 * names that match the property name with " get " and " set " prepended , or with the { @ link StoreAs } annotation set
 * with the property name . The methods must have return types or parameter data types that match the data type of
 * the corresponding { @ link EntityProperty } value . If such a pair is found , the data is copied from the instance
 * object by invoking the getter method on the instance . Properties that do not have a method pair with matching
 * name and data type are not copied .
 * @ param instance
 * An < code > Object < / code > reference to an instance of a class implementing { @ link TableEntity } to
 * serialize the table entity
 * data from .
 * @ return
 * A < code > java . util . HashMap < / code > object which maps < code > String < / code > property names to
 * { @ link EntityProperty } objects containing typed data values serialized from the instance parameter
 * object .
 * @ throws IllegalArgumentException
 * if the table entity is invalid or improperly formatted .
 * @ throws IllegalAccessException
 * if the table entity threw an exception during serialization .
 * @ throws InvocationTargetException
 * if a method invoked on the instance parameter threw an exception during serialization . */
public static HashMap < String , EntityProperty > writeEntityWithReflection ( final Object instance ) throws IllegalArgumentException , IllegalAccessException , InvocationTargetException { } }

implementation: final HashMap < String , PropertyPair > props = PropertyPair . generatePropertyPairs ( instance . getClass ( ) ) ; final HashMap < String , EntityProperty > retVal = new HashMap < String , EntityProperty > ( ) ; for ( final Entry < String , PropertyPair > p : props . entrySet ( ) ) { retVal . put ( p . getValue ( ) . effectiveName , p . getValue ( ) . generateEntityProperty ( instance ) ) ; } return retVal ;


signature:
public class TableServiceEntity { /** * Sets a boolean representing whether or not the reflected entity cache is disabled . For most scenarios , disabling
 * the reflected entity cache is not recommended due to its effect on performance .
 * The reflected entity cache stores known entity types and their respective reflected entity dictionaries . Rather
 * than using reflection on a known entity type , the values from the dictionary are used instead .
 * @ param disableReflectedEntityCache
 * < code > true < / code > to disable the reflected entity cache ; otherwise , < code > false < / code > . */
public static void setReflectedEntityCacheDisabled ( boolean disableReflectedEntityCache ) { } }

implementation: if ( TableServiceEntity . reflectedEntityCache != null && disableReflectedEntityCache ) { TableServiceEntity . reflectedEntityCache . clear ( ) ; } TableServiceEntity . disableReflectedEntityCache = disableReflectedEntityCache ;


signature:
public class TableServiceEntity { /** * Populates this table entity instance using the map of property names to { @ link EntityProperty } data typed values .
 * This method invokes { @ link TableServiceEntity # readEntityWithReflection } to populate the table entity instance the
 * method is called on using reflection . Table entity classes that extend { @ link TableServiceEntity } can take
 * advantage of this behavior by implementing getter and setter methods for the particular properties of the table
 * entity in Microsoft Azure storage the class represents .
 * Override this method in classes that extend { @ link TableServiceEntity } to invoke custom serialization code .
 * @ param properties
 * The < code > java . util . HashMap < / code > of < code > String < / code > property names to { @ link EntityProperty }
 * data values to deserialize and store in this table entity instance .
 * @ param opContext
 * An { @ link OperationContext } object used to track the execution of the operation .
 * @ throws StorageException
 * if an error occurs during the deserialization . */
@ Override public void readEntity ( final HashMap < String , EntityProperty > properties , final OperationContext opContext ) throws StorageException { } }

implementation: try { readEntityWithReflection ( this , properties , opContext ) ; } catch ( IllegalArgumentException e ) { throw new StorageException ( StorageErrorCodeStrings . INVALID_DOCUMENT , SR . RESPONSE_RECEIVED_IS_INVALID , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; } catch ( IllegalAccessException e ) { throw new StorageException ( StorageErrorCodeStrings . INVALID_DOCUMENT , SR . EXCEPTION_THROWN_DURING_DESERIALIZATION , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; } catch ( InvocationTargetException e ) { throw new StorageException ( StorageErrorCodeStrings . INTERNAL_ERROR , SR . EXCEPTION_THROWN_DURING_DESERIALIZATION , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; }


signature:
public class TableServiceEntity { /** * Returns a map of property names to { @ link EntityProperty } data typed values created by serializing this table
 * entity instance .
 * This method invokes { @ link # writeEntityWithReflection } to serialize the table entity instance the method is
 * called on using reflection . Table entity classes that extend { @ link TableServiceEntity } can take advantage of
 * this behavior by implementing getter and setter methods for the particular properties of the table entity in
 * Microsoft Azure storage the class represents . Note that the property names " PartitionKey " , " RowKey " , and
 * " Timestamp " are reserved and will be ignored if set on other methods with the { @ link StoreAs } annotation .
 * Override this method in classes that extend { @ link TableServiceEntity } to invoke custom serialization code .
 * @ param opContext
 * An { @ link OperationContext } object used to track the execution of the operation .
 * @ return
 * A < code > java . util . HashMap < / code > of < code > String < / code > property names to { @ link EntityProperty } data
 * typed values representing the properties serialized from this table entity instance .
 * @ throws StorageException
 * if an error occurs during the serialization . */
@ Override public HashMap < String , EntityProperty > writeEntity ( final OperationContext opContext ) throws StorageException { } }

implementation: try { return writeEntityWithReflection ( this ) ; } catch ( final IllegalAccessException e ) { throw new StorageException ( StorageErrorCodeStrings . INTERNAL_ERROR , SR . ATTEMPTED_TO_SERIALIZE_INACCESSIBLE_PROPERTY , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; } catch ( final InvocationTargetException e ) { throw new StorageException ( StorageErrorCodeStrings . INTERNAL_ERROR , SR . EXCEPTION_THROWN_DURING_SERIALIZATION , Constants . HeaderConstants . HTTP_UNUSED_306 , null , e ) ; }


signature:
public class BaseResponse { /** * Gets the Date
 * @ param request
 * The response from server .
 * @ return The Date . */
public static String getDate ( final HttpURLConnection request ) { } }

implementation: final String retString = request . getHeaderField ( "Date" ) ; return retString == null ? request . getHeaderField ( Constants . HeaderConstants . DATE ) : retString ;


signature:
public class BaseResponse { /** * Gets the metadata from the request The response from server .
 * @ return the metadata from the request */
public static HashMap < String , String > getMetadata ( final HttpURLConnection request ) { } }

implementation: return getValuesByHeaderPrefix ( request , Constants . HeaderConstants . PREFIX_FOR_STORAGE_METADATA ) ;


signature:
public class BaseResponse { /** * Gets if the request was encrypted by the server .
 * @ param request
 * The response from the server .
 * @ return A boolean indicating if the request was encrypted by the server . */
public static boolean isServerRequestEncrypted ( HttpURLConnection request ) { } }

implementation: return Constants . TRUE . equals ( request . getHeaderField ( Constants . HeaderConstants . SERVER_REQUEST_ENCRYPTED ) ) ;


signature:
public class BaseResponse { /** * Returns all the header / value pairs with the given prefix .
 * @ param request
 * the request object containing headers to parse .
 * @ param prefix
 * the prefix for headers to be returned .
 * @ return all the header / value pairs with the given prefix . */
private static HashMap < String , String > getValuesByHeaderPrefix ( final HttpURLConnection request , final String prefix ) { } }

implementation: final HashMap < String , String > retVals = new HashMap < String , String > ( ) ; final Map < String , List < String > > headerMap = request . getHeaderFields ( ) ; final int prefixLength = prefix . length ( ) ; for ( final Entry < String , List < String > > entry : headerMap . entrySet ( ) ) { if ( entry . getKey ( ) != null && entry . getKey ( ) . startsWith ( prefix ) ) { final List < String > currHeaderValues = entry . getValue ( ) ; retVals . put ( entry . getKey ( ) . substring ( prefixLength ) , currHeaderValues . get ( 0 ) ) ; } } return retVals ;


signature:
public class TableStorageErrorDeserializer { /** * Gets the Extended Error information .
 * @ return the Extended Error information .
 * @ param reader
 * the input stream to read error details from .
 * @ param format
 * The { @ link TablePayloadFormat } to use for parsing
 * @ throws IOException
 * if an error occurs while accessing the stream with Json . */
public static StorageExtendedErrorInformation getExtendedErrorInformation ( final Reader reader , final TablePayloadFormat format ) throws JsonParseException , IOException { } }

implementation:
JsonFactory jsonFactory = new JsonFactory ( ) ; JsonParser parser = jsonFactory . createParser ( reader ) ; try { final StorageExtendedErrorInformation errorInfo = new StorageExtendedErrorInformation ( ) ; if ( ! parser . hasCurrentToken ( ) ) { parser . nextToken ( ) ; } JsonUtilities . assertIsStartObjectJsonToken ( parser ) ; parser . nextToken ( ) ; JsonUtilities . assertIsFieldNameJsonToken ( parser ) ; JsonUtilities . assertIsExpectedFieldName ( parser , "odata.error" ) ; // start getting extended error information
parser . nextToken ( ) ; JsonUtilities . assertIsStartObjectJsonToken ( parser ) ; // get code
parser . nextValue ( ) ; JsonUtilities . assertIsExpectedFieldName ( parser , TableConstants . ErrorConstants . ERROR_CODE ) ; errorInfo . setErrorCode ( parser . getValueAsString ( ) ) ; // get message
parser . nextToken ( ) ; JsonUtilities . assertIsFieldNameJsonToken ( parser ) ; JsonUtilities . assertIsExpectedFieldName ( parser , TableConstants . ErrorConstants . ERROR_MESSAGE ) ; parser . nextToken ( ) ; JsonUtilities . assertIsStartObjectJsonToken ( parser ) ; parser . nextValue ( ) ; JsonUtilities . assertIsExpectedFieldName ( parser , "lang" ) ; parser . nextValue ( ) ; JsonUtilities . assertIsExpectedFieldName ( parser , "value" ) ; errorInfo . setErrorMessage ( parser . getValueAsString ( ) ) ; parser . nextToken ( ) ; JsonUtilities . assertIsEndObjectJsonToken ( parser ) ; parser . nextToken ( ) ; // get innererror if it exists
if ( parser . getCurrentToken ( ) == JsonToken . FIELD_NAME ) { JsonUtilities . assertIsExpectedFieldName ( parser , TableConstants . ErrorConstants . INNER_ERROR ) ; errorInfo . getAdditionalDetails ( ) . putAll ( parseJsonErrorException ( parser ) ) ; parser . nextToken ( ) ; } // end code object
JsonUtilities . assertIsEndObjectJsonToken ( parser ) ; // end odata . error object
parser . nextToken ( ) ; JsonUtilities . assertIsEndObjectJsonToken ( parser ) ; return errorInfo ; } finally { parser . close ( ) ; }


signature:
public class TableStorageErrorDeserializer { /** * Parse the table extended error information from the response body .
 * @ param request
 * the request whose body to examine for the error information .
 * @ return The { @ link StorageExtendedErrorInformation } parsed from the body or null if parsing fails or the request
 * contains no body . */
public static StorageExtendedErrorInformation parseErrorDetails ( StorageRequest < CloudTableClient , ? , ? > request ) { } }

implementation: try { if ( request == null || request . getConnection ( ) . getErrorStream ( ) == null ) { return null ; } return getExtendedErrorInformation ( new InputStreamReader ( request . getConnection ( ) . getErrorStream ( ) ) , TablePayloadFormat . Json ) ; } catch ( Exception e ) { return null ; }


signature:
public class TableStorageErrorDeserializer { /** * Parses the error exception details from the Json - formatted response .
 * @ param parser
 * the { @ link JsonParser } to use for parsing
 * @ throws IOException
 * if an error occurs while accessing the stream with Json .
 * @ throws JsonParseException
 * if an error occurs while parsing the stream . */
private static HashMap < String , String [ ] > parseJsonErrorException ( JsonParser parser ) throws JsonParseException , IOException { } }

implementation: HashMap < String , String [ ] > additionalDetails = new HashMap < String , String [ ] > ( ) ; parser . nextToken ( ) ; JsonUtilities . assertIsStartObjectJsonToken ( parser ) ; parser . nextToken ( ) ; JsonUtilities . assertIsFieldNameJsonToken ( parser ) ; while ( parser . getCurrentToken ( ) != JsonToken . END_OBJECT ) { if ( parser . getCurrentName ( ) . equals ( TableConstants . ErrorConstants . ERROR_MESSAGE ) ) { parser . nextToken ( ) ; additionalDetails . put ( TableConstants . ErrorConstants . ERROR_MESSAGE , new String [ ] { parser . getValueAsString ( ) } ) ; } else if ( parser . getCurrentName ( ) . equals ( TableConstants . ErrorConstants . ERROR_EXCEPTION_TYPE ) ) { parser . nextToken ( ) ; additionalDetails . put ( TableConstants . ErrorConstants . ERROR_EXCEPTION_TYPE , new String [ ] { parser . getValueAsString ( ) } ) ; } else if ( parser . getCurrentName ( ) . equals ( TableConstants . ErrorConstants . ERROR_EXCEPTION_STACK_TRACE ) ) { parser . nextToken ( ) ; additionalDetails . put ( Constants . ERROR_EXCEPTION_STACK_TRACE , new String [ ] { parser . getValueAsString ( ) } ) ; } parser . nextToken ( ) ; } return additionalDetails ;


signature:
public class SharedAccessPolicyHandler { /** * RESERVED FOR INTERNAL USE . Gets the HashMap of SharedAccessPolicies from the response .
 * @ param stream
 * the stream to read from
 * @ param cls
 * the < code > SharedAccessPolicy < / code > class type
 * @ return the HashMap of SharedAccessPolicies from the response
 * @ throws SAXException
 * @ throws ParserConfigurationException
 * @ throws ParseException
 * if a date is incorrectly encoded in the stream
 * @ throws IOException */
public static < T extends SharedAccessPolicy > HashMap < String , T > getAccessIdentifiers ( final InputStream stream , final Class < T > cls ) throws ParserConfigurationException , SAXException , IOException { } }

implementation: SAXParser saxParser = Utility . getSAXParser ( ) ; SharedAccessPolicyHandler < T > handler = new SharedAccessPolicyHandler < T > ( cls ) ; saxParser . parse ( stream , handler ) ; return handler . policies ;


signature:
public class FileResponse { /** * Gets the copyState
 * @ param request
 * The response from server .
 * @ return The CopyState .
 * @ throws URISyntaxException
 * @ throws ParseException */
public static CopyState getCopyState ( final HttpURLConnection request ) throws URISyntaxException , ParseException { } }

implementation: String copyStatusString = request . getHeaderField ( Constants . HeaderConstants . COPY_STATUS ) ; if ( ! Utility . isNullOrEmpty ( copyStatusString ) ) { final CopyState copyState = new CopyState ( ) ; copyState . setStatus ( CopyStatus . parse ( copyStatusString ) ) ; copyState . setCopyId ( request . getHeaderField ( Constants . HeaderConstants . COPY_ID ) ) ; copyState . setStatusDescription ( request . getHeaderField ( Constants . HeaderConstants . COPY_STATUS_DESCRIPTION ) ) ; final String copyProgressString = request . getHeaderField ( Constants . HeaderConstants . COPY_PROGRESS ) ; if ( ! Utility . isNullOrEmpty ( copyProgressString ) ) { String [ ] progressSequence = copyProgressString . split ( "/" ) ; copyState . setBytesCopied ( Long . parseLong ( progressSequence [ 0 ] ) ) ; copyState . setTotalBytes ( Long . parseLong ( progressSequence [ 1 ] ) ) ; } final String copySourceString = request . getHeaderField ( Constants . HeaderConstants . COPY_SOURCE ) ; if ( ! Utility . isNullOrEmpty ( copySourceString ) ) { copyState . setSource ( new URI ( copySourceString ) ) ; } final String copyCompletionTimeString = request . getHeaderField ( Constants . HeaderConstants . COPY_COMPLETION_TIME ) ; if ( ! Utility . isNullOrEmpty ( copyCompletionTimeString ) ) { copyState . setCompletionTime ( Utility . parseRFC1123DateFromStringInGMT ( copyCompletionTimeString ) ) ; } return copyState ; } else { return null ; }


signature:
public class FileResponse { /** * Gets the FileShareAttributes from the given request .
 * @ param request
 * the request to get attributes from
 * @ param usePathStyleUris
 * a value indicating if the account is using pathSytleUris
 * @ return the FileShareAttributes from the given request .
 * @ throws StorageException */
public static FileShareAttributes getFileShareAttributes ( final HttpURLConnection request , final boolean usePathStyleUris ) throws StorageException { } }

implementation: final FileShareAttributes shareAttributes = new FileShareAttributes ( ) ; final FileShareProperties shareProperties = shareAttributes . getProperties ( ) ; shareProperties . setEtag ( BaseResponse . getEtag ( request ) ) ; shareProperties . setShareQuota ( parseShareQuota ( request ) ) ; shareProperties . setLastModified ( new Date ( request . getLastModified ( ) ) ) ; shareAttributes . setMetadata ( getMetadata ( request ) ) ; return shareAttributes ;


signature:
public class FileResponse { /** * Gets the FileDirectoryAttributes from the given request .
 * @ param request
 * the request to get attributes from .
 * @ param usePathStyleUris
 * a value indicating if the account is using pathSytleUris .
 * @ return the FileDirectoryAttributes from the given request .
 * @ throws StorageException */
public static FileDirectoryAttributes getFileDirectoryAttributes ( final HttpURLConnection request , final boolean usePathStyleUris ) throws StorageException { } }

implementation: final FileDirectoryAttributes directoryAttributes = new FileDirectoryAttributes ( ) ; URI tempURI ; try { tempURI = PathUtility . stripSingleURIQueryAndFragment ( request . getURL ( ) . toURI ( ) ) ; } catch ( final URISyntaxException e ) { final StorageException wrappedUnexpectedException = Utility . generateNewUnexpectedStorageException ( e ) ; throw wrappedUnexpectedException ; } directoryAttributes . setName ( PathUtility . getDirectoryNameFromURI ( tempURI , usePathStyleUris ) ) ; final FileDirectoryProperties directoryProperties = directoryAttributes . getProperties ( ) ; directoryProperties . setEtag ( BaseResponse . getEtag ( request ) ) ; directoryProperties . setLastModified ( new Date ( request . getLastModified ( ) ) ) ; directoryAttributes . setMetadata ( getMetadata ( request ) ) ; directoryProperties . setServerEncrypted ( Constants . TRUE . equals ( request . getHeaderField ( Constants . HeaderConstants . SERVER_ENCRYPTED ) ) ) ; return directoryAttributes ;


signature:
public class FileResponse { /** * Gets the CloudFileAttributes from the given request
 * @ param request
 * The response from server .
 * @ param resourceURI
 * The file uri to set .
 * @ return the CloudFileAttributes from the given request
 * @ throws ParseException
 * @ throws URISyntaxException */
public static FileAttributes getFileAttributes ( final HttpURLConnection request , final StorageUri resourceURI ) throws URISyntaxException , ParseException { } }

implementation:
final FileAttributes fileAttributes = new FileAttributes ( ) ; final FileProperties properties = fileAttributes . getProperties ( ) ; properties . setCacheControl ( request . getHeaderField ( Constants . HeaderConstants . CACHE_CONTROL ) ) ; properties . setContentDisposition ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_DISPOSITION ) ) ; properties . setContentEncoding ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_ENCODING ) ) ; properties . setContentLanguage ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_LANGUAGE ) ) ; // For range gets , only look at ' x - ms - content - md5 ' for overall MD5
if ( ! Utility . isNullOrEmpty ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_RANGE ) ) ) { properties . setContentMD5 ( request . getHeaderField ( FileConstants . FILE_CONTENT_MD5_HEADER ) ) ; } else { properties . setContentMD5 ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_MD5 ) ) ; } properties . setContentType ( request . getHeaderField ( Constants . HeaderConstants . CONTENT_TYPE ) ) ; properties . setEtag ( BaseResponse . getEtag ( request ) ) ; properties . setCopyState ( FileResponse . getCopyState ( request ) ) ; properties . setServerEncrypted ( Constants . TRUE . equals ( request . getHeaderField ( Constants . HeaderConstants . SERVER_ENCRYPTED ) ) ) ; final Calendar lastModifiedCalendar = Calendar . getInstance ( Utility . LOCALE_US ) ; lastModifiedCalendar . setTimeZone ( Utility . UTC_ZONE ) ; lastModifiedCalendar . setTime ( new Date ( request . getLastModified ( ) ) ) ; properties . setLastModified ( lastModifiedCalendar . getTime ( ) ) ; final String rangeHeader = request . getHeaderField ( Constants . HeaderConstants . CONTENT_RANGE ) ; final String xContentLengthHeader = request . getHeaderField ( FileConstants . CONTENT_LENGTH_HEADER ) ; if ( ! Utility . isNullOrEmpty ( rangeHeader ) ) { properties . setLength ( Long . parseLong ( rangeHeader . split ( "/" ) [ 1 ] ) ) ; } else if ( ! Utility . isNullOrEmpty ( xContentLengthHeader ) ) { properties . setLength ( Long . parseLong ( xContentLengthHeader ) ) ; } else { // using this instead of the request property since the request
// property only returns an int .
final String contentLength = request . getHeaderField ( Constants . HeaderConstants . CONTENT_LENGTH ) ; if ( ! Utility . isNullOrEmpty ( contentLength ) ) { properties . setLength ( Long . parseLong ( contentLength ) ) ; } } fileAttributes . setStorageUri ( resourceURI ) ; fileAttributes . setMetadata ( BaseResponse . getMetadata ( request ) ) ; return fileAttributes ;


signature:
public class FileResponse { /** * Parses out the share quota value from a < code > java . net . HttpURLConnection < / code > .
 * @ param request
 * the request to get attributes from
 * @ return the share quota ( in GB ) or < code > null < / code > if none is specified */
static Integer parseShareQuota ( final HttpURLConnection request ) { } }

implementation: Integer shareQuota = request . getHeaderFieldInt ( FileConstants . SHARE_QUOTA_HEADER , - 1 ) ; return ( shareQuota == - 1 ) ? null : shareQuota ;


signature:
public class MimePart { /** * Reserved for internal use . Returns the HTTP verb for a table operation .
 * @ param operationType
 * The { @ link TableOperation } instance to get the HTTP verb for .
 * @ return
 * A < code > String < / code > containing the HTTP verb to use with the operation . */
static String getHttpVerbForOperation ( final TableOperationType operationType ) { } }

implementation: if ( operationType == TableOperationType . INSERT ) { return "POST" ; } else if ( operationType == TableOperationType . DELETE ) { return "DELETE" ; } else if ( operationType == TableOperationType . MERGE || operationType == TableOperationType . INSERT_OR_MERGE ) { return "MERGE" ; } else if ( operationType == TableOperationType . REPLACE || operationType == TableOperationType . INSERT_OR_REPLACE ) { return "PUT" ; } else if ( operationType == TableOperationType . RETRIEVE ) { return "GET" ; } else { throw new IllegalArgumentException ( SR . UNKNOWN_TABLE_OPERATION ) ; }


signature:
public class TableServiceException { /** * Reserved for internal use . A static factory method to create a { @ link TableServiceException } instance using
 * the specified parameters .
 * @ param res
 * A { @ link RequestResult } containing the result of the table storage service operation .
 * @ param op
 * The { @ link TableOperation } representing the table operation that caused the exception .
 * @ param inStream
 * The < code > java . io . InputStream < / code > of the error response from the table operation request .
 * @ param format
 * The { @ link TablePayloadFormat } to use for parsing
 * @ return
 * A { @ link TableServiceException } instance initialized with values from the input parameters . */
protected static TableServiceException generateTableServiceException ( RequestResult res , TableOperation op , InputStream inStream , TablePayloadFormat format ) { } }

implementation: return new TableServiceException ( res . getStatusCode ( ) , res . getStatusMessage ( ) , op , new InputStreamReader ( inStream ) , format ) ;


signature:
public class FileRequestOptions { /** * Uses the concurrent request count from the specified client if < code > null < / code > , sets a default value for
 * everything else , and sets defaults as defined in the parent class .
 * @ param options
 * The input options to copy from when applying defaults
 * @ param client
 * A { @ link CloudFileClient } object that represents the service client used to set the default timeout
 * interval and retry policy , if they are < code > null < / code > . Additionally , if the
 * { @ link # concurrentRequestCount } field ' s value is null , it will be set to the value specified by the
 * cloud file client ' s { @ link CloudFileClient # getConcurrentRequestCount } method . */
protected static final FileRequestOptions populateAndApplyDefaults ( final FileRequestOptions options , final CloudFileClient client ) { } }

implementation: return FileRequestOptions . populateAndApplyDefaults ( options , client , true ) ;