/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App.Storage/Ftp/FtpStorageFile.cs
29 строк
830 B
0x5BFA
Code Quality: Re-organize the structure of Files.App.Storage (#17340)
29 июл 2025, 00:54
Не верифицирован
29 июл 2025, 00:54
7203007
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using System.IO; namespace Files.App.Storage { public sealed class FtpStorageFile : FtpStorable, IChildFile { public FtpStorageFile(string path, string name, IFolder? parent) : base(path, name, parent) { } /// <inheritdoc/> public async Task<Stream> OpenStreamAsync(FileAccess access, CancellationToken cancellationToken = default) { using var ftpClient = GetFtpClient(); await ftpClient.EnsureConnectedAsync(cancellationToken); if (access.HasFlag(FileAccess.Write)) return await ftpClient.OpenWrite(Id, token: cancellationToken); else if (access.HasFlag(FileAccess.Read)) return await ftpClient.OpenRead(Id, token: cancellationToken); else throw new ArgumentException($"Invalid {nameof(access)} flag."); } } }