Share via


IFileSystemOperations.CreateWithHttpMessagesAsync Method

Definition

Creates a file with optionally specified content. NOTE: If content is provided, the resulting file cannot be modified using ConcurrentAppend.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> CreateWithHttpMessagesAsync (string accountName, string directFilePath, System.IO.Stream streamContents = default, bool? overwrite = default, Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag? syncFlag = default, Guid? leaseId = default, int? permission = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> CreateWithHttpMessagesAsync (string accountName, string path, System.IO.Stream streamContents = default, bool? overwrite = default, Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag? syncFlag = default, Guid? leaseId = default, int? permission = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateWithHttpMessagesAsync : string * string * System.IO.Stream * Nullable<bool> * Nullable<Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag> * Nullable<Guid> * Nullable<int> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse>
abstract member CreateWithHttpMessagesAsync : string * string * System.IO.Stream * Nullable<bool> * Nullable<Microsoft.Azure.Management.DataLake.Store.Models.SyncFlag> * Nullable<Guid> * Nullable<int> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse>
Public Function CreateWithHttpMessagesAsync (accountName As String, directFilePath As String, Optional streamContents As Stream = Nothing, Optional overwrite As Nullable(Of Boolean) = Nothing, Optional syncFlag As Nullable(Of SyncFlag) = Nothing, Optional leaseId As Nullable(Of Guid) = Nothing, Optional permission As Nullable(Of Integer) = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse)
Public Function CreateWithHttpMessagesAsync (accountName As String, path As String, Optional streamContents As Stream = Nothing, Optional overwrite As Nullable(Of Boolean) = Nothing, Optional syncFlag As Nullable(Of SyncFlag) = Nothing, Optional leaseId As Nullable(Of Guid) = Nothing, Optional permission As Nullable(Of Integer) = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse)

Parameters

accountName
String

The Azure Data Lake Store account to execute filesystem operations on.

directFilePathpath
String

The Data Lake Store path (starting with '/') of the file to create.

streamContents
Stream

The file contents to include when creating the file. This parameter is optional, resulting in an empty file if not specified.

overwrite
Nullable<Boolean>

The indication of if the file should be overwritten.

syncFlag
Nullable<SyncFlag>

Optionally indicates what to do after completion of the create. DATA indicates that more data will be sent immediately by the client, the file handle should remain open/locked, and file metadata (including file length, last modified time) should NOT get updated. METADATA indicates that more data will be sent immediately by the client, the file handle should remain open/locked, and file metadata should get updated. CLOSE indicates that the client is done sending data, the file handle should be closed/unlocked, and file metadata should get updated. Possible values include: 'DATA', 'METADATA', 'CLOSE'

leaseId
Nullable<Guid>

Optional unique GUID per file to ensure single writer semantics, meaning that only clients that append to the file with the same leaseId will be allowed to do so.

permission
Nullable<Int32>

The octal representation of the unnamed user, mask and other permissions that should be set for the file when created. If not specified, it inherits these from the container.

customHeaders
Dictionary<String,List<String>>

The headers that will be added to request.

cancellationToken
CancellationToken

The cancellation token.

Returns

Exceptions

Thrown when the operation returned an invalid status code

Thrown when a required parameter is null

Applies to