microsoft-azure-storage/src/com/microsoft/azure/storage/StorageCredentialsSharedAccessSignature.java
@Override
    public URI transformUri(final URI resourceUri, final OperationContext opContext)
            throws URISyntaxException, StorageException {
        if (resourceUri == null) {
            return null;
        }
        
        if(this.isHttpsOnly() && !resourceUri.getScheme().equals(Constants.HTTPS)) {
            throw new IllegalArgumentException(SR.CANNOT_TRANSFORM_NON_HTTPS_URI_WITH_HTTPS_ONLY_CREDENTIALS);
        }
            
        // append the sas token to the resource uri
        URI sasUri = PathUtility.addToQuery(resourceUri, this.token);
        
        // append the api version parameter to the sas uri
        String apiVersion = Constants.QueryConstants.API_VERSION + "=" + Constants.HeaderConstants.TARGET_STORAGE_VERSION;
        return PathUtility.addToQuery(sasUri, apiVersion);
    }
@Override
    public URI transformUri(final URI resourceUri, final OperationContext opContext)
            throws URISyntaxException, StorageException {
        if (resourceUri == null) {
            return null;
        }
        
        if(this.isHttpsOnly() && !resourceUri.getScheme().equals(Constants.HTTPS)) {
            throw new IllegalArgumentException(SR.CANNOT_TRANSFORM_NON_HTTPS_URI_WITH_HTTPS_ONLY_CREDENTIALS);
        }
            
        // append the sas token to the resource uri
        URI sasUri = PathUtility.addToQuery(resourceUri, this.token);
        
        // append the api version parameter to the sas uri
        String apiVersion = Constants.QueryConstants.API_VERSION + "=" + Constants.HeaderConstants.TARGET_STORAGE_VERSION;
        return PathUtility.addToQuery(sasUri, apiVersion);
    }
@ Override public URI transformUri ( final URI resourceUri , final OperationContext opContext ) throws URISyntaxException , StorageException { if ( resourceUri == null ) { return null ; } if ( this . isHttpsOnly ( ) && ! resourceUri . getScheme ( ) . equals ( Constants . HTTPS ) ) { throw new IllegalArgumentException ( SR . CANNOT_TRANSFORM_NON_HTTPS_URI_WITH_HTTPS_ONLY_CREDENTIALS ) ; } // append the sas token to the resource uri URI sasUri = PathUtility . addToQuery ( resourceUri , this . token ) ; // append the api version parameter to the sas uri String apiVersion = Constants . QueryConstants . API_VERSION + "=" + Constants . HeaderConstants . TARGET_STORAGE_VERSION ; return PathUtility . addToQuery ( sasUri , apiVersion ) ; }
Transforms a resource URI into a shared access signature URI, by appending a shared access token and using the
specified operation context.

@param resourceUri
A <code>java.net.URI</code> object that represents the resource URI to be transformed.
@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 <code>java.net.URI</code> object that represents the signature, including the resource URI and the
shared access token.

@throws StorageException
If a storage service error occurred.
@throws URISyntaxException
If the resource URI is not properly formatted.
Transforms a resource URI into a shared access signature URI by appending a shared access token and using the specified operation context .