Exemple #1
0
            /// <summary>
            /// Create
            /// </summary>
            /// <param name="logger"></param>
            /// <param name="file"></param>
            /// <param name="leaseId"></param>
            /// <param name="ct"></param>
            /// <returns></returns>
            internal static async Task <FileSystemFile> CreateOrOpenAsync(ILogger logger,
                                                                          DataLakeFileClient file, string leaseId, CancellationToken ct)
            {
                try {
                    await file.CreateIfNotExistsAsync(cancellationToken : ct);

                    return(new FileSystemFile(file, leaseId, logger));
                }
                catch (RequestFailedException ex) {
                    ((HttpStatusCode)ex.Status).Validate(ex.Message, ex);
                    return(null);
                }
            }