@DoesServiceRequest
    public boolean createIfNotExists(FileRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException {
        options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);

        this.getShare().assertNoSnapshot();

        boolean exists = this.exists(true /* primaryOnly */, null /* accessCondition */, options, opContext);
        if (exists) {
            return false;
        }
        else {
            try {
                this.create(options, opContext);
                return true;
            }
            catch (StorageException e) {
                if (e.getHttpStatusCode() == HttpURLConnection.HTTP_CONFLICT
                        && StorageErrorCodeStrings.RESOURCE_ALREADY_EXISTS.equals(e.getErrorCode())) {
                    return false;
                }
                else {
                    throw e;
                }
            }
        }
    }
@DoesServiceRequest
    public boolean createIfNotExists(FileRequestOptions options, OperationContext opContext) throws StorageException, URISyntaxException {
        options = FileRequestOptions.populateAndApplyDefaults(options, this.fileServiceClient);

        this.getShare().assertNoSnapshot();

        boolean exists = this.exists(true , null , options, opContext);
        if (exists) {
            return false;
        }
        else {
            try {
                this.create(options, opContext);
                return true;
            }
            catch (StorageException e) {
                if (e.getHttpStatusCode() == HttpURLConnection.HTTP_CONFLICT
                        && StorageErrorCodeStrings.RESOURCE_ALREADY_EXISTS.equals(e.getErrorCode())) {
                    return false;
                }
                else {
                    throw e;
                }
            }
        }
    }
@ DoesServiceRequest public boolean createIfNotExists ( FileRequestOptions options , OperationContext opContext ) throws StorageException , URISyntaxException { options = FileRequestOptions . populateAndApplyDefaults ( options , this . fileServiceClient ) ; this . getShare ( ) . assertNoSnapshot ( ) ; boolean exists = this . exists ( true /* primaryOnly */ , null /* accessCondition */ , options , opContext ) ; if ( exists ) { return false ; } else { try { this . create ( options , opContext ) ; return true ; } catch ( StorageException e ) { if ( e . getHttpStatusCode ( ) == HttpURLConnection . HTTP_CONFLICT && StorageErrorCodeStrings . RESOURCE_ALREADY_EXISTS . equals ( e . getErrorCode ( ) ) ) { return false ; } else { throw e ; } } } }
Creates the directory if it does not exist, using the specified request options and operation context.

@param options
A {@link FileRequestOptions} 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 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.

@return <code>true</code> if the directory did not already exist and was created; otherwise, <code>false</code>.

@throws StorageException
If a storage service error occurred.
@throws URISyntaxException
Creates the directory if it does not exist using the specified request options and operation context .