C# Class 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.
Mostra file Open project: OneDrive/onedrive-sdk-csharp Class Usage Examples

Private Properties

Property Type Description
GetRangesRemaining long>>.List
NextChunkSize int

Public Methods

Method Description
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.

Private Methods

Method Description
GetRangesRemaining ( UploadSession session ) : long>>.List
NextChunkSize ( long rangeBegin, long rangeEnd ) : int

Method Details

ChunkedUploadProvider() public method

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. .
return Microsoft.Graph

DeleteSession() public method

Delete the session.
public DeleteSession ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

GetChunkRequestResponseAsync() public method

public GetChunkRequestResponseAsync ( UploadChunkRequest request, byte readBuffer, ICollection exceptionTrackingList ) : Task
request UploadChunkRequest
readBuffer byte
exceptionTrackingList ICollection
return Task

GetUploadChunkRequests() public method

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.
return IEnumerable

UpdateSessionStatusAsync() public method

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
return Task

UploadAsync() public method

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
return Task