public String generateSharedAccessSignature ( final SharedAccessFilePolicy policy , final String groupPolicyIdentifier , final IPRange ipRange , final SharedAccessProtocols protocols ) throws InvalidKeyException , StorageException { if ( ! StorageCredentialsHelper . canCredentialsSignRequest ( this . fileServiceClient . getCredentials ( ) ) ) { final String errorMessage = SR . CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY ; throw new IllegalArgumentException ( errorMessage ) ; } final String resourceName = this . getSharedAccessCanonicalName ( ) ; final String signature = SharedAccessSignatureHelper . generateSharedAccessSignatureHashForBlobAndFile ( policy , null /* SharedAccessHeaders */ , groupPolicyIdentifier , resourceName , ipRange , protocols , this . fileServiceClient ) ; final UriQueryBuilder builder = SharedAccessSignatureHelper . generateSharedAccessSignatureForBlobAndFile ( policy , null /* SharedAccessHeaders */ , groupPolicyIdentifier , "s" , ipRange , protocols , signature ) ; return builder . toString ( ) ; }
Returns a shared access signature for the share . Note this does not contain the leading ? .