C# Класс Microsoft.OneDrive.Sdk.Helpers.ChunkedUploadProvider

Use this class to make resumable uploads or to upload large files. This class allows the client to control the size of chunks uploaded (for example, can be useful to use small chunks if the connection is slow). Also allows the client to pause an upload and resume later.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
GetRangesRemaining long>>.List
NextChunkSize int

Открытые методы

Метод Описание
ChunkedUploadProvider ( UploadSession session, IBaseClient client, Stream uploadStream, int maxChunkSize = -1 ) : Microsoft.Graph

Helps with resumable uploads. Generates chunk requests based on session information, and can control uploading of requests using client

DeleteSession ( ) : System.Threading.Tasks.Task

Delete the session.

GetChunkRequestResponseAsync ( UploadChunkRequest request, byte readBuffer, ICollection exceptionTrackingList ) : Task
GetUploadChunkRequests ( IEnumerable options = null ) : IEnumerable

Get the series of requests needed to complete the upload session. Call UpdateSessionStatusAsync first to update the internal session information.

UpdateSessionStatusAsync ( ) : Task

Get the status of the session. Stores returned session internally. Updates internal list of ranges remaining to be uploaded (according to the server).

UploadAsync ( int maxTries = 3, IEnumerable options = null ) : Task

Upload the whole session.

Приватные методы

Метод Описание
GetRangesRemaining ( UploadSession session ) : long>>.List
NextChunkSize ( long rangeBegin, long rangeEnd ) : int

Описание методов

ChunkedUploadProvider() публичный Метод

Helps with resumable uploads. Generates chunk requests based on session information, and can control uploading of requests using client
public ChunkedUploadProvider ( UploadSession session, IBaseClient client, Stream uploadStream, int maxChunkSize = -1 ) : Microsoft.Graph
session UploadSession Session information.
client IBaseClient Client used to upload chunks.
uploadStream Stream Readable, seekable stream to be uploaded. Length of session is determined via uploadStream.Length
maxChunkSize int Max size of each chunk to be uploaded. Multiple of 320 KiB (320 * 1024) is required. /// If less than 0, default value of 5 MiB is used. .
Результат Microsoft.Graph

DeleteSession() публичный Метод

Delete the session.
public DeleteSession ( ) : System.Threading.Tasks.Task
Результат System.Threading.Tasks.Task

GetChunkRequestResponseAsync() публичный Метод

public GetChunkRequestResponseAsync ( UploadChunkRequest request, byte readBuffer, ICollection exceptionTrackingList ) : Task
request UploadChunkRequest
readBuffer byte
exceptionTrackingList ICollection
Результат Task

GetUploadChunkRequests() публичный Метод

Get the series of requests needed to complete the upload session. Call UpdateSessionStatusAsync first to update the internal session information.
public GetUploadChunkRequests ( IEnumerable options = null ) : IEnumerable
options IEnumerable Options to be applied to each request.
Результат IEnumerable

UpdateSessionStatusAsync() публичный Метод

Get the status of the session. Stores returned session internally. Updates internal list of ranges remaining to be uploaded (according to the server).
public UpdateSessionStatusAsync ( ) : Task
Результат Task

UploadAsync() публичный Метод

Upload the whole session.
public UploadAsync ( int maxTries = 3, IEnumerable options = null ) : Task
maxTries int Number of times to retry entire session before giving up.
options IEnumerable
Результат Task