Interface IFileClient
- Namespace
- OpenShell
- Assembly
- OpenShell.Sdk.dll
File transfer between the local machine and a sandbox. Files travel as a tar stream over exec, so the sandbox image needs tar and sh.
public interface IFileClient
Methods
DownloadAsync(string, string, Stream, CancellationToken)
Downloads one remote file into destination.
ValueTask DownloadAsync(string sandbox, string remotePath, Stream destination, CancellationToken cancellationToken = default)
Parameters
sandboxstringremotePathstringdestinationStreamcancellationTokenCancellationToken
Returns
DownloadAsync(string, string, string, CancellationToken)
Downloads one remote file to localPath. The file is replaced atomically on success.
ValueTask DownloadAsync(string sandbox, string remotePath, string localPath, CancellationToken cancellationToken = default)
Parameters
sandboxstringremotePathstringlocalPathstringcancellationTokenCancellationToken
Returns
DownloadDirectoryAsync(string, string, string, CancellationToken)
Downloads a remote directory tree into localDirectory. Entries that would escape the destination,
and links of any kind, are rejected with InvalidDataException.
ValueTask DownloadDirectoryAsync(string sandbox, string remoteDirectory, string localDirectory, CancellationToken cancellationToken = default)
Parameters
sandboxstringremoteDirectorystringlocalDirectorystringcancellationTokenCancellationToken
Returns
UploadAsync(string, Stream, string, UnixFileMode?, CancellationToken)
Uploads content as the file remotePath. A non-seekable stream is buffered
in memory first because a tar header needs the size up front.
ValueTask UploadAsync(string sandbox, Stream content, string remotePath, UnixFileMode? mode = null, CancellationToken cancellationToken = default)
Parameters
sandboxstringcontentStreamremotePathstringmodeUnixFileMode?cancellationTokenCancellationToken
Returns
UploadAsync(string, string, string, CancellationToken)
Uploads one local file to remotePath, creating parent directories.
ValueTask UploadAsync(string sandbox, string localPath, string remotePath, CancellationToken cancellationToken = default)
Parameters
sandboxstringlocalPathstringremotePathstringcancellationTokenCancellationToken
Returns
UploadDirectoryAsync(string, string, string, CancellationToken)
Uploads the contents of a local directory into remoteDirectory, creating it if needed.
ValueTask UploadDirectoryAsync(string sandbox, string localDirectory, string remoteDirectory, CancellationToken cancellationToken = default)
Parameters
sandboxstringlocalDirectorystringremoteDirectorystringcancellationTokenCancellationToken