当前位置: 首页>>代码示例>>Java>>正文


Java UriQueryBuilder.add方法代码示例

本文整理汇总了Java中com.microsoft.azure.storage.core.UriQueryBuilder.add方法的典型用法代码示例。如果您正苦于以下问题:Java UriQueryBuilder.add方法的具体用法?Java UriQueryBuilder.add怎么用?Java UriQueryBuilder.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.microsoft.azure.storage.core.UriQueryBuilder的用法示例。


在下文中一共展示了UriQueryBuilder.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyContinuationToQueryBuilder

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Reserved for internal use. Adds continuation token values to the specified query builder, if set.
 * 
 * @param builder
 *            The {@link UriQueryBuilder} object to apply the continuation token properties to.
 * @param continuationToken
 *            The {@link ResultContinuation} object containing the continuation token values to apply to the query
 *            builder. Specify <code>null</code> if no continuation token values are set.
 * 
 * @throws StorageException
 *             if an error occurs in accessing the query builder or continuation token.
 */
private static void applyContinuationToQueryBuilder(final UriQueryBuilder builder,
        final ResultContinuation continuationToken) throws StorageException {
    if (continuationToken != null) {
        if (continuationToken.getNextPartitionKey() != null) {
            builder.add(TableConstants.TABLE_SERVICE_NEXT_PARTITION_KEY, continuationToken.getNextPartitionKey());
        }

        if (continuationToken.getNextRowKey() != null) {
            builder.add(TableConstants.TABLE_SERVICE_NEXT_ROW_KEY, continuationToken.getNextRowKey());
        }

        if (continuationToken.getNextTableName() != null) {
            builder.add(TableConstants.TABLE_SERVICE_NEXT_TABLE_NAME, continuationToken.getNextTableName());
        }
    }
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:29,代码来源:TableRequest.java

示例2: listFilesAndDirectories

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a request to return a listing of all files and directories 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.
 * @return a HttpURLConnection configured for the operation.
 * @throws IOException
 * @throws URISyntaxException
 * @throws StorageException
 * @throws IllegalArgumentException
 */
public static HttpURLConnection listFilesAndDirectories(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final ListingContext listingContext) throws URISyntaxException,
        IOException, StorageException {

    final UriQueryBuilder builder = getDirectoryUriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.LIST);

    if (listingContext != null) {
        if (!Utility.isNullOrEmpty(listingContext.getMarker())) {
            builder.add(Constants.QueryConstants.MARKER, listingContext.getMarker());
        }

        if (listingContext.getMaxResults() != null && listingContext.getMaxResults() > 0) {
            builder.add(Constants.QueryConstants.MAX_RESULTS, listingContext.getMaxResults().toString());
        }
    }

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

    request.setRequestMethod(Constants.HTTP_GET);

    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:46,代码来源:FileRequest.java

示例3: listShares

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * 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
 */
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;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:58,代码来源:FileRequest.java

示例4: putBlock

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to upload a block. Sign with length of block data.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param blockId
 *            the Base64 ID for the block
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection putBlock(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String blockId)
        throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, BLOCK_QUERY_ELEMENT_NAME);
    builder.add(BLOCK_ID_QUERY_ELEMENT_NAME, blockId);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    return request;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:45,代码来源:BlobRequest.java

示例5: putBlockList

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to write a blob by specifying the list of block IDs that make up the blob. Sign
 * with length of block list data.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection putBlockList(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final BlobProperties properties)
        throws IOException, URISyntaxException, StorageException {

    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, BLOCK_LIST_QUERY_ELEMENT_NAME);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    addProperties(request, properties);

    return request;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:46,代码来源:BlobRequest.java

示例6: getBlockList

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to return a list of the block blobs blocks. Sign with no length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param snapshotVersion
 *            The snapshot version, if the blob is a snapshot.
 * @param blockFilter
 *            The types of blocks to include in the list: committed, uncommitted, or both.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection getBlockList(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion,
        final BlockListingFilter blockFilter) throws StorageException, IOException, URISyntaxException {

    final UriQueryBuilder builder = new UriQueryBuilder();

    builder.add(Constants.QueryConstants.COMPONENT, BLOCK_LIST_QUERY_ELEMENT_NAME);
    builder.add(BLOCK_LIST_TYPE_QUERY_ELEMENT_NAME, blockFilter.toString());
    BlobRequest.addSnapshot(builder, snapshotVersion);

    final HttpURLConnection request = BaseRequest.createURLConnection(uri, blobOptions, builder, opContext);
    request.setRequestMethod(Constants.HTTP_GET);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:48,代码来源:BlobRequest.java

示例7: getPageRanges

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to return a list of the PageBlob's page ranges. Sign with no length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param snapshotVersion
 *            The snapshot version, if the blob is a snapshot.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection getPageRanges(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion)
        throws StorageException, IOException, URISyntaxException {

    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, PAGE_LIST_QUERY_ELEMENT_NAME);
    BlobRequest.addSnapshot(builder, snapshotVersion);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);
    request.setRequestMethod(Constants.HTTP_GET);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    BaseRequest.addOptionalHeader(request, BlobConstants.SNAPSHOT, snapshotVersion);
    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:45,代码来源:BlobRequest.java

示例8: putMessage

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a web request to add a message to the back of the queue. Write the encoded message request body
 * generated with a call to QueueMessageSerializer#generateMessageRequestBody(String)} to the output
 * stream of the request. Sign the web request with the length of the encoded message request body.
 * 
 * @param uri
 *            A <code>URI</code> object that specifies the absolute URI to
 *            the queue.
 * @param queueOptions
 *            A {@link QueueRequestOptions} 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 CloudQueueClient}.
 * @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 visibilityTimeoutInSeconds
 *            Specifies the length of time for the message to be invisible
 *            in seconds, starting when it is added to the queue. A value of
 *            0 will make the message visible immediately. The value must be
 *            greater than or equal to 0, and cannot be larger than 7 days.
 *            The visibility timeout of a message cannot be set to a value
 *            greater than the time-to-live time.
 * @param timeToLiveInSeconds
 *            Specifies the time-to-live interval for the message, in
 *            seconds. The maximum time-to-live allowed is 7 days. If this
 *            parameter is 0, the default time-to-live of 7 days is used.
 * @return An <code>HttpURLConnection</code> configured for the specified
 *         operation.
 * 
 * @throws IOException
 * @throws URISyntaxException
 *             If the URI is not valid.
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
public static HttpURLConnection putMessage(final URI uri, final QueueRequestOptions queueOptions,
        final OperationContext opContext, final int visibilityTimeoutInSeconds, final int timeToLiveInSeconds)
        throws IOException, URISyntaxException, StorageException {

    final UriQueryBuilder builder = new UriQueryBuilder();

    if (visibilityTimeoutInSeconds != 0) {
        builder.add(VISIBILITY_TIMEOUT, Integer.toString(visibilityTimeoutInSeconds));
    }

    if (timeToLiveInSeconds != 0) {
        builder.add(MESSAGE_TTL, Integer.toString(timeToLiveInSeconds));
    }

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

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_POST);

    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:59,代码来源:QueueRequest.java

示例9: getPageRanges

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to return a list of the PageBlob's page ranges. Sign with no length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param snapshotVersion
 *            The snapshot version, if the blob is a snapshot.
 * @param offset
 *            The offset at which to begin returning content.
 * @param count
 *            The number of bytes to return.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection getPageRanges(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion,
        final Long offset, final Long count) throws StorageException, IOException, URISyntaxException {

    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, PAGE_LIST_QUERY_ELEMENT_NAME);
    BlobRequest.addSnapshot(builder, snapshotVersion);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);
    request.setRequestMethod(Constants.HTTP_GET);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    addRange(request, offset, count);
    
    return request;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:50,代码来源:BlobRequest.java

示例10: putRange

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to upload a file range. Sign with file size for update, or 0 for clear.
 * 
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the file.
 * @param range
 *            a {link @FileRange} representing the file range
 * @param operationType
 *            a {link @FileRangeOperationType} enumeration value representing the file range operation type.
 * 
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection putRange(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final FileRange range,
        FileRangeOperationType operationType) throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, RANGE_QUERY_ELEMENT_NAME);

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

    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    if (operationType == FileRangeOperationType.CLEAR) {
        request.setFixedLengthStreamingMode(0);
    }

    // Range write is either update or clear; required
    request.setRequestProperty(FileConstants.FILE_RANGE_WRITE, operationType.toString());
    request.setRequestProperty(Constants.HeaderConstants.STORAGE_RANGE_HEADER, range.toString());

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:55,代码来源:FileRequest.java

示例11: setBlobProperties

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to set the blob's properties, Sign with zero length specified.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the blob.
 * @param properties
 *            The properties to upload.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection setBlobProperties(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final BlobProperties properties)
        throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.PROPERTIES);

    final HttpURLConnection request = createURLConnection(uri, builder, blobOptions, opContext);

    request.setFixedLengthStreamingMode(0);
    request.setDoOutput(true);
    request.setRequestMethod(Constants.HTTP_PUT);

    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    if (properties != null) {
        addProperties(request, properties);
    }

    return request;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:49,代码来源:BlobRequest.java

示例12: addSnapshot

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Adds the snapshot.
 * 
 * @param builder
 *            a query builder.
 * @param snapshotVersion
 *            the snapshot version to the query builder.
 * @throws StorageException
 */
private static void addSnapshot(final UriQueryBuilder builder, final String snapshotVersion)
        throws StorageException {
    if (snapshotVersion != null) {
        builder.add(Constants.QueryConstants.SNAPSHOT, snapshotVersion);
    }
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:16,代码来源:BlobRequest.java

示例13: leaseContainer

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to Acquire,Release,Break, or Renew a container lease. Sign with 0 length.
 * 
 * @param uri
 *            A <code>java.net.URI</code> object that specifies the absolute URI.
 * @param blobOptions
 *            A {@link BlobRequestOptions} 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 CloudBlobClient}.
 * @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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the container.
 * @param action
 *            the LeaseAction to perform
 * @param proposedLeaseId
 *            A <code>String</code> that represents the proposed lease ID for the new lease,
 *            or null if no lease ID is proposed.
 * @param breakPeriodInSeconds
 *            Specifies the amount of time to allow the lease to remain, in seconds.
 *            If null, the break period is the remainder of the current lease, or zero for infinite leases.
 * @param visibilityTimeoutInSeconds
 *            Specifies the the span of time for which to acquire the lease, in seconds.
 *            If null, an infinite lease will be acquired. If not null, this must be greater than zero.
 * @return a HttpURLConnection to use to perform the operation.
 * @throws IOException
 *             if there is an error opening the connection
 * @throws URISyntaxException
 *             if the resource URI is invalid
 * @throws StorageException
 *             an exception representing any error which occurred during the operation.
 * @throws IllegalArgumentException
 */
public static HttpURLConnection leaseContainer(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final LeaseAction action,
        final Integer leaseTimeInSeconds, final String proposedLeaseId, final Integer breakPeriodInSeconds)
        throws IOException, URISyntaxException, StorageException {

    final UriQueryBuilder builder = getContainerUriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, BlobConstants.LEASE);

    return lease(uri, blobOptions, opContext, accessCondition, action, leaseTimeInSeconds, proposedLeaseId,
            breakPeriodInSeconds, builder);
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:47,代码来源:BlobRequest.java

示例14: deleteMessage

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete a message from the queue. Sign the web
 * request with a length of -1L.
 * 
 * @param uri
 *            A <code>URI</code> object that specifies the absolute URI to
 *            the queue.
 * @param queueOptions
 *            A {@link QueueRequestOptions} 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 CloudQueueClient}.
 * @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 popReceipt
 *            A <code>String</code> that contains the pop receipt value
 *            returned from an earlier call to {@link CloudQueueMessage#getPopReceipt} for the message to
 *            delete.
 * @return An <code>HttpURLConnection</code> configured for the specified
 *         operation.
 * 
 * @throws URISyntaxException
 *             If the URI is not valid.
 * @throws IOException
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
public static HttpURLConnection deleteMessage(final URI uri, final QueueRequestOptions queueOptions,
        final OperationContext opContext, final String popReceipt) throws URISyntaxException, IOException,
        StorageException {

    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(POP_RECEIPT, popReceipt);

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

    request.setRequestMethod(Constants.HTTP_DELETE);

    return request;
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:43,代码来源:QueueRequest.java

示例15: getAcl

import com.microsoft.azure.storage.core.UriQueryBuilder; //导入方法依赖的package包/类
/**
 * Constructs a web request to return the ACL for this queue. Sign with no length specified.
 * 
 * @param uri
 *            The absolute URI to the container.
 * @param queueOptions
 *            A {@link QueueRequestOptions} 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 CloudQueueClient}.
 * @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 HttpURLConnection configured for the operation.
 * @throws StorageException
 */
public static HttpURLConnection getAcl(final URI uri, final QueueRequestOptions queueOptions,
        final OperationContext opContext) throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    builder.add(Constants.QueryConstants.COMPONENT, Constants.QueryConstants.ACL);

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

    request.setRequestMethod(Constants.HTTP_GET);

    return request;
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:28,代码来源:QueueRequest.java


注:本文中的com.microsoft.azure.storage.core.UriQueryBuilder.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。