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


Java BaseRequest.delete方法代码示例

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


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

示例1: deleteShare

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete the share and all of the directories and files within it. 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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the share.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 * @throws IllegalArgumentException
 */
public static HttpURLConnection deleteShare(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final AccessCondition accessCondition, String snapshotVersion, DeleteShareSnapshotsOption deleteSnapshotsOption) 
                throws IOException, URISyntaxException, StorageException {
    final UriQueryBuilder shareBuilder = getShareUriQueryBuilder();
    FileRequest.addShareSnapshot(shareBuilder, snapshotVersion);
    HttpURLConnection request = BaseRequest.delete(uri, fileOptions, shareBuilder, opContext);
    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

    switch (deleteSnapshotsOption) {
    case NONE:
        // nop
        break;
    case INCLUDE_SNAPSHOTS:
        request.setRequestProperty(Constants.HeaderConstants.DELETE_SNAPSHOT_HEADER,
                Constants.HeaderConstants.INCLUDE_SNAPSHOTS_VALUE);
        break;
    default:
        break;
    }

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

示例2: deleteBlob

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to delete the blob, 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 deleteSnapshotsOption
 *            A set of options indicating whether to delete only blobs, only snapshots, 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 deleteBlob(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition, final String snapshotVersion,
        final DeleteSnapshotsOption deleteSnapshotsOption) throws IOException, URISyntaxException, StorageException {

    if (snapshotVersion != null && deleteSnapshotsOption != DeleteSnapshotsOption.NONE) {
        throw new IllegalArgumentException(String.format(SR.DELETE_SNAPSHOT_NOT_VALID_ERROR,
                "deleteSnapshotsOption", "snapshot"));
    }

    final UriQueryBuilder builder = new UriQueryBuilder();
    BlobRequest.addSnapshot(builder, snapshotVersion);
    final HttpURLConnection request = BaseRequest.delete(uri, blobOptions, builder, opContext);

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

    switch (deleteSnapshotsOption) {
        case NONE:
            // nop
            break;
        case INCLUDE_SNAPSHOTS:
            request.setRequestProperty(Constants.HeaderConstants.DELETE_SNAPSHOT_HEADER,
                    BlobConstants.INCLUDE_SNAPSHOTS_VALUE);
            break;
        case DELETE_SNAPSHOTS_ONLY:
            request.setRequestProperty(Constants.HeaderConstants.DELETE_SNAPSHOT_HEADER,
                    BlobConstants.SNAPSHOTS_ONLY_VALUE);
            break;
        default:
            break;
    }

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

示例3: deleteContainer

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete the container and all of blobs within it. 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 container.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 * @throws IllegalArgumentException
 */
public static HttpURLConnection deleteContainer(final URI uri, final BlobRequestOptions blobOptions,
        final OperationContext opContext, final AccessCondition accessCondition) throws IOException,
        URISyntaxException, StorageException {
    final UriQueryBuilder containerBuilder = getContainerUriQueryBuilder();
    HttpURLConnection request = BaseRequest.delete(uri, blobOptions, containerBuilder, opContext);
    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

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

示例4: deleteFile

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a HttpURLConnection to delete the file, 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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the file.
 * @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 deleteFile(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final AccessCondition accessCondition) throws IOException,
        URISyntaxException, StorageException {
    final UriQueryBuilder builder = new UriQueryBuilder();
    final HttpURLConnection request = BaseRequest.delete(uri, fileOptions, builder, opContext);
    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

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

示例5: deleteShare

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete the share and all of the directories and files within it. 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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the share.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 * @throws IllegalArgumentException
 */
public static HttpURLConnection deleteShare(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final AccessCondition accessCondition) throws IOException,
        URISyntaxException, StorageException {
    final UriQueryBuilder shareBuilder = getShareUriQueryBuilder();
    HttpURLConnection request = BaseRequest.delete(uri, fileOptions, shareBuilder, opContext);
    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

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

示例6: deleteDirectory

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete the directory and all of the directories and files within it. 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 accessCondition
 *            An {@link AccessCondition} object that represents the access conditions for the directory.
 * @return a HttpURLConnection configured for the operation.
 * @throws StorageException
 * @throws IllegalArgumentException
 */
public static HttpURLConnection deleteDirectory(final URI uri, final FileRequestOptions fileOptions,
        final OperationContext opContext, final AccessCondition accessCondition) throws IOException,
        URISyntaxException, StorageException {
    final UriQueryBuilder directoryBuilder = getDirectoryUriQueryBuilder();
    HttpURLConnection request = BaseRequest.delete(uri, fileOptions, directoryBuilder, opContext);
    if (accessCondition != null) {
        accessCondition.applyConditionToRequest(request);
    }

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

示例7: deleteMessage

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的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.delete(uri, queueOptions, builder, opContext);

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

示例8: delete

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to delete 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.
 * 
 * @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 delete(final URI uri, final QueueRequestOptions queueOptions,
        final OperationContext opContext) throws IOException, URISyntaxException, StorageException {
    return BaseRequest.delete(uri, queueOptions, null, opContext);
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:31,代码来源:QueueRequest.java

示例9: clearMessages

import com.microsoft.azure.storage.core.BaseRequest; //导入方法依赖的package包/类
/**
 * Constructs a web request to clear all the messages in 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.
 * 
 * @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 clearMessages(final URI uri, final QueueRequestOptions queueOptions,
        final OperationContext opContext) throws URISyntaxException, IOException, StorageException {
    return BaseRequest.delete(uri, queueOptions, null, opContext);
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:31,代码来源:QueueRequest.java


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