Zum Hauptinhalt springen

FileDownload

Namespace: Meshmakers.Octo.Sdk.ServiceClient.AssetRepositoryServices.Files

A streamed download: the content stream plus the metadata of the response. Dispose it to release the HTTP response.

public sealed class FileDownload : IDisposable, IAsyncDisposable

Inheritance Object → FileDownload
Implements IDisposable, IAsyncDisposable

Properties​

Content​

The content stream (read it once, forward only).

public Stream Content { get; }

Property Value​

Stream

FileName​

File name sent by the server (RFC 6266/5987 filename* preferred over filename).

public string FileName { get; }

Property Value​

String

ContentType​

Content type sent by the server.

public string ContentType { get; }

Property Value​

String

ContentLength​

Content length, when the server sent one (zip downloads are streamed without).

public Nullable<long> ContentLength { get; }

Property Value​

Nullable<Int64>

ETag​

ETag sent by the server.

public string ETag { get; }

Property Value​

String

Constructors​

FileDownload(Stream, String, String, Nullable<Int64>, String, IDisposable)​

Constructor.

public FileDownload(Stream content, string fileName, string contentType, Nullable<long> contentLength, string eTag, IDisposable owner)

Parameters​

content Stream
The content stream

fileName String
File name from Content-Disposition, if any

contentType String
Content type, if any

contentLength Nullable<Int64>
Content length, if known

eTag String
ETag (the binary id, quoted), if any

owner IDisposable
Object disposed together with the download (the HTTP response)

Methods​

Dispose()​

public void Dispose()

DisposeAsync()​

public ValueTask DisposeAsync()

Returns​

ValueTask