microsoft-azure-storage/src/com/microsoft/azure/storage/core/SharedAccessSignatureHelper.java
public static StorageCredentialsSharedAccessSignature parseQuery(final HashMap<String, String[]> queryParams)
            throws StorageException {
        
        boolean sasParameterFound = false;
        List<String> removeList = new ArrayList<String>();
        for (final Entry<String, String[]> entry : queryParams.entrySet()) {
            final String lowerKey = entry.getKey().toLowerCase(Utility.LOCALE_US);

            if (lowerKey.equals(Constants.QueryConstants.SIGNATURE)) {
                sasParameterFound = true;
            } else if (lowerKey.equals(Constants.QueryConstants.COMPONENT)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.RESOURCETYPE)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.SNAPSHOT)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.API_VERSION)) {
                removeList.add(entry.getKey());
            } 
        }
        
        for (String removeParam : removeList) {
            queryParams.remove(removeParam);
        }

        if (sasParameterFound) {
            final UriQueryBuilder builder = new UriQueryBuilder();
            
            StringBuilder values = new StringBuilder();
            for (final Entry<String, String[]> entry : queryParams.entrySet()) {
                values.setLength(0);
                for (int i = 0; i < entry.getValue().length; i++) {
                    values.append(entry.getValue()[i]);
                    values.append(',');
                }
                values.deleteCharAt(values.length() - 1);
                
                addIfNotNullOrEmpty(builder, entry.getKey().toLowerCase(), values.toString());
            }

            return new StorageCredentialsSharedAccessSignature(builder.toString());
        }

        return null;
    }
public static StorageCredentialsSharedAccessSignature parseQuery(final HashMap<String, String[]> queryParams)
            throws StorageException {
        
        boolean sasParameterFound = false;
        List<String> removeList = new ArrayList<String>();
        for (final Entry<String, String[]> entry : queryParams.entrySet()) {
            final String lowerKey = entry.getKey().toLowerCase(Utility.LOCALE_US);

            if (lowerKey.equals(Constants.QueryConstants.SIGNATURE)) {
                sasParameterFound = true;
            } else if (lowerKey.equals(Constants.QueryConstants.COMPONENT)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.RESOURCETYPE)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.SNAPSHOT)) {
                removeList.add(entry.getKey());
            } else if (lowerKey.equals(Constants.QueryConstants.API_VERSION)) {
                removeList.add(entry.getKey());
            } 
        }
        
        for (String removeParam : removeList) {
            queryParams.remove(removeParam);
        }

        if (sasParameterFound) {
            final UriQueryBuilder builder = new UriQueryBuilder();
            
            StringBuilder values = new StringBuilder();
            for (final Entry<String, String[]> entry : queryParams.entrySet()) {
                values.setLength(0);
                for (int i = 0; i < entry.getValue().length; i++) {
                    values.append(entry.getValue()[i]);
                    values.append(',');
                }
                values.deleteCharAt(values.length() - 1);
                
                addIfNotNullOrEmpty(builder, entry.getKey().toLowerCase(), values.toString());
            }

            return new StorageCredentialsSharedAccessSignature(builder.toString());
        }

        return null;
    }
Parses the query parameters and populates a StorageCredentialsSharedAccessSignature object if one is present.

@param queryParams
The parameters to parse.

@return The StorageCredentialsSharedAccessSignature if one is present, otherwise null.
@throws StorageException
An exception representing any error which occurred during the operation.