microsoft-azure-storage/src/com/microsoft/azure/storage/core/Canonicalizer.java
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();
    }
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.

@param address
the request URI
@param accountName
the account name associated with the request
@param method
the verb to be used for the HTTP request.
@param contentType
the content type of the HTTP request.
@param contentLength
the length of the content written to the outputstream in bytes, -1 if unknown
@param date
the date/time specification for the HTTP request
@param conn
the HttpURLConnection for the operation.
@return A canonicalized string.
@throws StorageException