다음을 통해 공유


FileSystemOperationsExtensions.SetFileExpiryAsync 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 static System.Threading.Tasks.Task SetFileExpiryAsync (this Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations operations, string accountName, string filePath, Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType expiryOption, long? expireTime = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task SetFileExpiryAsync (this Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations operations, string accountName, string path, Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType expiryOption, long? expireTime = default, System.Threading.CancellationToken cancellationToken = default);
static member SetFileExpiryAsync : Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations * string * string * Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
static member SetFileExpiryAsync : Microsoft.Azure.Management.DataLake.Store.IFileSystemOperations * string * string * Microsoft.Azure.Management.DataLake.Store.Models.ExpiryOptionType * Nullable<int64> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function SetFileExpiryAsync (operations As IFileSystemOperations, accountName As String, filePath As String, expiryOption As ExpiryOptionType, Optional expireTime As Nullable(Of Long) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task
<Extension()>
Public Function SetFileExpiryAsync (operations As IFileSystemOperations, accountName As String, path As String, expiryOption As ExpiryOptionType, Optional expireTime As Nullable(Of Long) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

operations
IFileSystemOperations

The operations group for this extension method.

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.

cancellationToken
CancellationToken

The cancellation token.

Returns

Applies to