microsoft-azure-storage/src/com/microsoft/azure/storage/table/CloudTable.java
@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 */);
        }
    }
@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 */);
        }
    }
@ 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 */ ) ; } }
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.
Returns a value that indicates whether the table exists in the storage service using the specified request options and operation context .