Delen via


IFileSystemOperations.SetFileExpiryWithHttpMessagesAsync Method

Definition

Sets or removes the expiration time on the specified file. This operation can only be executed against files. Folders are not supported.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> SetFileExpiryWithHttpMessagesAsync (string accountName, string filePath, Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType expiryOption, long? expireTime = 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> SetFileExpiryWithHttpMessagesAsync (string accountName, string path, Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType expiryOption, long? expireTime = default, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SetFileExpiryWithHttpMessagesAsync : string * string * Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType * Nullable<int64> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse>
abstract member SetFileExpiryWithHttpMessagesAsync : string * string * Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType * Nullable<int64> * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse>
Public Function SetFileExpiryWithHttpMessagesAsync (accountName As String, filePath As String, expiryOption As ExpiryOptionType, Optional expireTime As Nullable(Of Long) = Nothing, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse)
Public Function SetFileExpiryWithHttpMessagesAsync (accountName As String, path As String, expiryOption As ExpiryOptionType, Optional expireTime As Nullable(Of Long) = 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.

filePathpath
String

The Data Lake Store path (starting with '/') of the file on which to set or remove the expiration time.

expiryOption
ExpiryOptionType

Indicates the type of expiration to use for the file: 1. NeverExpire: ExpireTime is ignored. 2. RelativeToNow: ExpireTime is an integer in milliseconds representing the expiration date relative to when file expiration is updated. 3. RelativeToCreationDate: ExpireTime is an integer in milliseconds representing the expiration date relative to file creation. 4. Absolute: ExpireTime is an integer in milliseconds, as a Unix timestamp relative to 1/1/1970 00:00:00. Possible values include: 'NeverExpire', 'RelativeToNow', 'RelativeToCreationDate', 'Absolute'

expireTime
Nullable<Int64>

The time that the file will expire, corresponding to the ExpiryOption that was set.

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