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


Java StorageErrorCodeStrings.OUT_OF_RANGE_INPUT属性代码示例

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


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

示例1: exists

/**
 * Returns a value that indicates whether the table exists in the storage service, using the specified request
 * options and operation context.
 *
 * @param options
 *            A {@link TableRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudTableClient}).
 * @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 <code>true</code> if the table exists in the storage service, otherwise <code>false</code>.
 *
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
@DoesServiceRequest
private boolean exists(final boolean primaryOnly, TableRequestOptions options, OperationContext opContext)
        throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = TableRequestOptions.applyDefaults(options, this.tableServiceClient);

    Utility.assertNotNullOrEmpty("tableName", this.name);

    QueryTableOperation operation = (QueryTableOperation) TableOperation.retrieve(this.name /* Used As PK */,
            null/* Row Key */, DynamicTableEntity.class);
    operation.setPrimaryOnlyRetrieve(primaryOnly);

    final TableResult result = operation.execute(this.tableServiceClient,
            TableConstants.TABLES_SERVICE_TABLES_NAME, options, opContext);

    if (result.getHttpStatusCode() == HttpURLConnection.HTTP_OK) {
        return true;
    }
    else if (result.getHttpStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
        return false;
    }
    else {
        throw new StorageException(StorageErrorCodeStrings.OUT_OF_RANGE_INPUT, SR.UNEXPECTED_STATUS_CODE_RECEIVED,
                result.getHttpStatusCode(), null /* extendedErrorInfo */, null /* innerException */);
    }
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:48,代码来源:CloudTable.java

示例2: exists

/**
 * Returns a value that indicates whether the table exists in the storage service, using the specified request
 * options and operation context.
 *
 * @param options
 *            A {@link TableRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudTableClient}).
 * @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 <code>true</code> if the table exists in the storage service, otherwise <code>false</code>.
 *
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
@DoesServiceRequest
private boolean exists(final boolean primaryOnly, TableRequestOptions options, OperationContext opContext)
        throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = TableRequestOptions.populateAndApplyDefaults(options, this.tableServiceClient);

    Utility.assertNotNullOrEmpty("tableName", this.name);

    QueryTableOperation operation = (QueryTableOperation) TableOperation.retrieve(this.name /* Used As PK */,
            null/* Row Key */, DynamicTableEntity.class);
    operation.setPrimaryOnlyRetrieve(primaryOnly);

    final TableResult result = operation.execute(this.tableServiceClient,
            TableConstants.TABLES_SERVICE_TABLES_NAME, options, opContext);

    if (result.getHttpStatusCode() == HttpURLConnection.HTTP_OK) {
        return true;
    }
    else if (result.getHttpStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
        return false;
    }
    else {
        throw new StorageException(StorageErrorCodeStrings.OUT_OF_RANGE_INPUT, SR.UNEXPECTED_STATUS_CODE_RECEIVED,
                result.getHttpStatusCode(), null /* extendedErrorInfo */, null /* innerException */);
    }
}
 
开发者ID:Azure,项目名称:azure-storage-android,代码行数:48,代码来源:CloudTable.java

示例3: exists

/**
 * Returns a value that indicates whether the table exists in the storage service, using the specified request
 * options and operation context.
 *
 * @param options
 *            A {@link TableRequestOptions} object that specifies any additional options for the request. Specifying
 *            <code>null</code> will use the default request options from the associated service client (
 *            {@link CloudTableClient}).
 * @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 <code>true</code> if the table exists in the storage service, otherwise <code>false</code>.
 *
 * @throws StorageException
 *             If a storage service error occurred during the operation.
 */
@DoesServiceRequest
private boolean exists(final boolean primaryOnly, TableRequestOptions options, OperationContext opContext)
        throws StorageException {
    if (opContext == null) {
        opContext = new OperationContext();
    }

    opContext.initialize();
    options = TableRequestOptions.populateAndApplyDefaults(options, this.tableServiceClient);
    options.clearEncryption();

    Utility.assertNotNullOrEmpty("tableName", this.name);

    QueryTableOperation operation = (QueryTableOperation) TableOperation.retrieve(this.name /* Used As PK */,
            null/* Row Key */, DynamicTableEntity.class);
    operation.setPrimaryOnlyRetrieve(primaryOnly);

    final TableResult result = operation.execute(this.tableServiceClient,
            TableConstants.TABLES_SERVICE_TABLES_NAME, options, opContext);

    if (result.getHttpStatusCode() == HttpURLConnection.HTTP_OK) {
        return true;
    }
    else if (result.getHttpStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
        return false;
    }
    else {
        throw new StorageException(StorageErrorCodeStrings.OUT_OF_RANGE_INPUT, SR.UNEXPECTED_STATUS_CODE_RECEIVED,
                result.getHttpStatusCode(), null /* extendedErrorInfo */, null /* innerException */);
    }
}
 
开发者ID:Azure,项目名称:azure-storage-java,代码行数:49,代码来源:CloudTable.java

示例4: generateMimeParseException

/**
 * Reserved for internal use. A static factory method that generates a {@link StorageException} for invalid MIME
 * responses.
 * 
 * @return
 *         The {@link StorageException} for the invalid MIME response.
 */
private static StorageException generateMimeParseException() {
    return new StorageException(StorageErrorCodeStrings.OUT_OF_RANGE_INPUT, SR.INVALID_MIME_RESPONSE,
            Constants.HeaderConstants.HTTP_UNUSED_306, null, null);
}
 
开发者ID:horizon-institute,项目名称:runspotrun-android-client,代码行数:11,代码来源:MimeHelper.java


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