microsoft-azure-storage/src/com/microsoft/azure/storage/file/FileRequest.java
public static HttpURLConnection listShares(final URI uri, final FileRequestOptions fileOptions,
            final OperationContext opContext, final ListingContext listingContext,
            final EnumSet<ShareListingDetails> detailsIncluded) throws URISyntaxException, IOException, StorageException {
        final UriQueryBuilder builder = BaseRequest.getListUriQueryBuilder(listingContext);

        if (detailsIncluded != null && detailsIncluded.size() > 0) {
            final StringBuilder sb = new StringBuilder();
            boolean started = false;

            if (detailsIncluded.contains(ShareListingDetails.SNAPSHOTS)) {
                started = true;
                sb.append(SNAPSHOTS_QUERY_ELEMENT_NAME);
            }
    
            if (detailsIncluded.contains(ShareListingDetails.METADATA)) {
                if (started)
                {
                    sb.append(",");
                }

                sb.append(Constants.QueryConstants.METADATA);
            }

            builder.add(Constants.QueryConstants.INCLUDE, sb.toString());
        }

        final HttpURLConnection request = BaseRequest.createURLConnection(uri, fileOptions, builder, opContext);

        request.setRequestMethod(Constants.HTTP_GET);

        return request;
    }
public static HttpURLConnection listShares(final URI uri, final FileRequestOptions fileOptions,
            final OperationContext opContext, final ListingContext listingContext,
            final EnumSet<ShareListingDetails> detailsIncluded) throws URISyntaxException, IOException, StorageException {
        final UriQueryBuilder builder = BaseRequest.getListUriQueryBuilder(listingContext);

        if (detailsIncluded != null && detailsIncluded.size() > 0) {
            final StringBuilder sb = new StringBuilder();
            boolean started = false;

            if (detailsIncluded.contains(ShareListingDetails.SNAPSHOTS)) {
                started = true;
                sb.append(SNAPSHOTS_QUERY_ELEMENT_NAME);
            }
    
            if (detailsIncluded.contains(ShareListingDetails.METADATA)) {
                if (started)
                {
                    sb.append(",");
                }

                sb.append(Constants.QueryConstants.METADATA);
            }

            builder.add(Constants.QueryConstants.INCLUDE, sb.toString());
        }

        final HttpURLConnection request = BaseRequest.createURLConnection(uri, fileOptions, builder, opContext);

        request.setRequestMethod(Constants.HTTP_GET);

        return request;
    }
Constructs a request to return a listing of all shares in this storage account. Sign with no length
specified.

@param uri
A <code>java.net.URI</code> object that specifies the absolute URI.
@param fileOptions
A {@link FileRequestOptions} object that specifies execution options such as retry policy and timeout
settings for the operation. Specify <code>null</code> to use the request options specified on the
{@link CloudFileClient}.
@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.
@param listingContext
A set of parameters for the listing operation.
@param detailsIncluded
A <code>java.util.EnumSet</code> object that contains {@link ShareListingDetails} values that indicate
whether share snapshots and/or metadata will be returned.
@return a HttpURLConnection configured for the operation.
@throws IOException
@throws URISyntaxException
@throws StorageException
@throws IllegalArgumentException