C# Класс Google.GData.Client.ResumableUpload.ResumableUploader

this class handles the Resumable Upload protocol
Наследование: AsyncDataHandler
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
CreateMediaRelation string
EditMediaRelation string

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

Метод Описание
GetResumableCreateUri ( AtomLinkCollection links ) : Uri

returns the resumabled create media Uri for a given entry

GetResumableEditUri ( AtomLinkCollection links ) : Uri

returns the resumable edit media Uri for a given entry

InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, AbstractEntry entry ) : Uri

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI

InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, AbstractEntry entry, string httpMethod ) : Uri

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI

InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, string contentType, string slug, long contentLength ) : Uri

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI

InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, string contentType, string slug, long contentLength, string httpMethod ) : Uri

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI

Insert ( Authenticator authentication, AbstractEntry payload ) : WebResponse

Uploads an entry, including it's media to the uri given inside the entry.

Insert ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug ) : WebResponse

Uploads just the media media to the uri given.

InsertAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
InsertAsync ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug, object userData ) : void
QueryStatus ( Authenticator authentication, Uri targetUri ) : long

asks the server about the current status

ResumableUploader ( ) : System

Default constructor. Uses the default chunksize of 25 megabyte

ResumableUploader ( int chunkSize ) : System

ResumableUploader constructor.

Resume ( Authenticator authentication, Uri resumeUri, String httpMethod, Stream payload, string contentType ) : WebResponse
ResumeAsync ( Authenticator authentication, Uri resumeUri, String httpmethod, Stream payload, string contentType, object userData ) : void
Update ( Authenticator authentication, AbstractEntry payload ) : WebResponse

Uploads an entry, including its media to the uri given inside the entry

Update ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType ) : WebResponse

Uploads just the media to the uri given.

UpdateAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
UpdateAsync ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, object userData ) : void
UploadStream ( string httpMethod, Uri sessionUri, Authenticator authentication, Stream payload, string mediaType, AsyncData data ) : WebResponse

Note the URI passed in here, is the session URI obtained by InitiateUpload

Защищенные методы

Метод Описание
CopyData ( Stream input, HttpWebRequest request, int partIndex, AsyncData data, Uri requestId ) : bool

takes our copy of the stream, and puts it into the request stream returns FALSE when we are done by reaching the end of the input stream

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

Метод Описание
AsyncInsertWorker ( AsyncResumableUploadData data, AsyncOperation asyncOp, SendOrPostCallback completionMethodDelegate ) : void

worker method for the the resumable insert

AsyncResumeWorker ( AsyncResumableUploadData data, AsyncOperation asyncOp, SendOrPostCallback completionMethodDelegate ) : void

worker method to handle the resume operation

AsyncStarter ( AsyncResumableUploadData data, WorkerResumableUploadHandler workerDelegate, Object userData ) : void

starts the async job

AsyncUpdateWorker ( AsyncResumableUploadData data, AsyncOperation asyncOp, SendOrPostCallback completionMethodDelegate ) : void

worker method for the resumable update

GetStreamLength ( Stream s ) : long
Insert ( Authenticator authentication, AbstractEntry payload, AsyncData data ) : WebResponse
Insert ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug, AsyncData data ) : WebResponse
PrepareRequest ( Uri target, Authenticator authentication, string slug, string contentType, long contentLength ) : HttpWebRequest
PrepareRequest ( Uri target, Authenticator authentication, string slug, string contentType, long contentLength, string httpMethod ) : HttpWebRequest
Resume ( Authenticator authentication, Uri resumeUri, String httpmethod, Stream payload, string contentType, AsyncData data ) : WebResponse
Update ( Authenticator authentication, AbstractEntry payload, AsyncData data ) : WebResponse
Update ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, AsyncData data ) : WebResponse
UploadStreamPart ( int partIndex, string httpMethod, Uri sessionUri, Authenticator authentication, Stream payload, string mediaType, AsyncData data ) : HttpWebResponse

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

CopyData() защищенный Метод

takes our copy of the stream, and puts it into the request stream returns FALSE when we are done by reaching the end of the input stream
protected CopyData ( Stream input, HttpWebRequest request, int partIndex, AsyncData data, Uri requestId ) : bool
input Stream
request System.Net.HttpWebRequest
partIndex int
data AsyncData
requestId System.Uri
Результат bool

GetResumableCreateUri() публичный статический Метод

returns the resumabled create media Uri for a given entry
public static GetResumableCreateUri ( AtomLinkCollection links ) : Uri
links AtomLinkCollection
Результат System.Uri

GetResumableEditUri() публичный статический Метод

returns the resumable edit media Uri for a given entry
public static GetResumableEditUri ( AtomLinkCollection links ) : Uri
links AtomLinkCollection
Результат System.Uri

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

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI
public InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, AbstractEntry entry ) : Uri
resumableUploadUri System.Uri
authentication Authenticator
entry AbstractEntry
Результат System.Uri

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

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI
public InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, AbstractEntry entry, string httpMethod ) : Uri
resumableUploadUri System.Uri
authentication Authenticator
entry AbstractEntry
httpMethod string
Результат System.Uri

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

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI
public InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, string contentType, string slug, long contentLength ) : Uri
resumableUploadUri System.Uri
authentication Authenticator
contentType string
slug string
contentLength long
Результат System.Uri

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

retrieves the resumable URI for the rest of the operation. This will initiate the communication with resumable upload server by posting against the starting URI
public InitiateUpload ( Uri resumableUploadUri, Authenticator authentication, string contentType, string slug, long contentLength, string httpMethod ) : Uri
resumableUploadUri System.Uri
authentication Authenticator
contentType string
slug string
contentLength long
httpMethod string
Результат System.Uri

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

Uploads an entry, including it's media to the uri given inside the entry.
public Insert ( Authenticator authentication, AbstractEntry payload ) : WebResponse
authentication Authenticator The authentication information to be used
payload AbstractEntry The entry to be uploaded. This is a complete entry, including the metadata. /// This will create a new entry on the service
Результат System.Net.WebResponse

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

Uploads just the media media to the uri given.
public Insert ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug ) : WebResponse
authentication Authenticator The authentication information to be used
resumableUploadUri System.Uri
payload Stream The media to uploaded.
contentType string The type of the content, e.g. text/html
slug string
Результат System.Net.WebResponse

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

public InsertAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
authentication Authenticator
payload AbstractEntry
userData object
Результат void

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

public InsertAsync ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, string slug, object userData ) : void
authentication Authenticator
resumableUploadUri System.Uri
payload Stream
contentType string
slug string
userData object
Результат void

QueryStatus() публичный статический Метод

asks the server about the current status
public static QueryStatus ( Authenticator authentication, Uri targetUri ) : long
authentication Authenticator
targetUri System.Uri
Результат long

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

Default constructor. Uses the default chunksize of 25 megabyte
public ResumableUploader ( ) : System
Результат System

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

ResumableUploader constructor.
public ResumableUploader ( int chunkSize ) : System
chunkSize int the upload chunksize in Megabytes, needs to be greater than 0
Результат System

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

public Resume ( Authenticator authentication, Uri resumeUri, String httpMethod, Stream payload, string contentType ) : WebResponse
authentication Authenticator
resumeUri System.Uri
httpMethod String
payload Stream
contentType string
Результат System.Net.WebResponse

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

public ResumeAsync ( Authenticator authentication, Uri resumeUri, String httpmethod, Stream payload, string contentType, object userData ) : void
authentication Authenticator
resumeUri System.Uri
httpmethod String
payload Stream
contentType string
userData object
Результат void

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

Uploads an entry, including its media to the uri given inside the entry
public Update ( Authenticator authentication, AbstractEntry payload ) : WebResponse
authentication Authenticator The authentication information to be used
payload AbstractEntry The entry to be uploaded. This is a complete entry, including the metadata. /// This will create a new entry on the service
Результат System.Net.WebResponse

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

Uploads just the media to the uri given.
public Update ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType ) : WebResponse
authentication Authenticator The authentication information to be used
resumableUploadUri System.Uri
payload Stream The media to uploaded.
contentType string The type of the content, e.g. text/html
Результат System.Net.WebResponse

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

public UpdateAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
authentication Authenticator
payload AbstractEntry
userData object
Результат void

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

public UpdateAsync ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, object userData ) : void
authentication Authenticator
resumableUploadUri System.Uri
payload Stream
contentType string
userData object
Результат void

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

Note the URI passed in here, is the session URI obtained by InitiateUpload
public UploadStream ( string httpMethod, Uri sessionUri, Authenticator authentication, Stream payload, string mediaType, AsyncData data ) : WebResponse
httpMethod string
sessionUri System.Uri
authentication Authenticator
payload Stream
mediaType string
data AsyncData
Результат System.Net.WebResponse

Описание свойств

CreateMediaRelation публичное статическое свойство

The relationship value to be used to find the resumable
public static string CreateMediaRelation
Результат string

EditMediaRelation публичное статическое свойство

public static string EditMediaRelation
Результат string