@ DoesServiceRequest public boolean deleteIfExists ( AccessCondition accessCondition , FileRequestOptions options , OperationContext opContext ) throws StorageException , URISyntaxException { options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; boolean exists = this . exists ( true /* primaryOnly */ , accessCondition , options , opContext ) ; if ( exists ) { try { this . delete ( accessCondition , options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_NOT_FOUND && StorageErrorCodeStrings . RESOURCE_NOT_FOUND . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } } else { return false ; } }
Deletes the directory if it exists using the specified request options and operation context .