本文整理汇总了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 */);
}
}
示例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 */);
}
}
示例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 */);
}
}
示例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);
}