protected static String canonicalizeTableHttpRequest ( final java . net . URL address , final String accountName , final String method , final String contentType , final long contentLength , final String date , final HttpURLConnection conn ) throws StorageException { // The first element should be the Method of the request. // I.e. GET, POST, PUT, or HEAD. final StringBuilder canonicalizedString = new StringBuilder ( ExpectedTableCanonicalizedStringLength ) ; canonicalizedString . append ( conn . getRequestMethod ( ) ) ; // The second element should be the MD5 value. // This is optional and may be empty. final String httpContentMD5Value = Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . CONTENT_MD5 ) ; appendCanonicalizedElement ( canonicalizedString , httpContentMD5Value ) ; // The third element should be the content type. appendCanonicalizedElement ( canonicalizedString , contentType ) ; // The fourth element should be the request date. // See if there's an storage date header. // If there's one, then don't use the date header. final String dateString = Utility . getStandardHeaderValue ( conn , Constants . HeaderConstants . DATE ) ; // If x-ms-date header exists, Date should be that value. appendCanonicalizedElement ( canonicalizedString , dateString . equals ( Constants . EMPTY_STRING ) ? date : dateString ) ; appendCanonicalizedElement ( canonicalizedString , getCanonicalizedResourceLite ( address , accountName ) ) ; return canonicalizedString . toString ( ) ; }
Constructs a canonicalized string that will be used to construct the signature string for signing a Table service request under the Shared Key authentication scheme .