C# Class Google.GData.Client.ResumableUpload.ResumableUploader

this class handles the Resumable Upload protocol
Inheritance: AsyncDataHandler
Afficher le fichier Open project: moljac/MonoMobile.Google.GData Class Usage Examples

Méthodes publiques

Свойство Type Description
CreateMediaRelation string
EditMediaRelation string

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

CopyData() protected méthode

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
Résultat bool

GetResumableCreateUri() public static méthode

returns the resumabled create media Uri for a given entry
public static GetResumableCreateUri ( AtomLinkCollection links ) : Uri
links AtomLinkCollection
Résultat System.Uri

GetResumableEditUri() public static méthode

returns the resumable edit media Uri for a given entry
public static GetResumableEditUri ( AtomLinkCollection links ) : Uri
links AtomLinkCollection
Résultat System.Uri

InitiateUpload() public méthode

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
Résultat System.Uri

InitiateUpload() public méthode

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
Résultat System.Uri

InitiateUpload() public méthode

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
Résultat System.Uri

InitiateUpload() public méthode

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
Résultat System.Uri

Insert() public méthode

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
Résultat System.Net.WebResponse

Insert() public méthode

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
Résultat System.Net.WebResponse

InsertAsync() public méthode

public InsertAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
authentication Authenticator
payload AbstractEntry
userData object
Résultat void

InsertAsync() public méthode

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
Résultat void

QueryStatus() public static méthode

asks the server about the current status
public static QueryStatus ( Authenticator authentication, Uri targetUri ) : long
authentication Authenticator
targetUri System.Uri
Résultat long

ResumableUploader() public méthode

Default constructor. Uses the default chunksize of 25 megabyte
public ResumableUploader ( ) : System
Résultat System

ResumableUploader() public méthode

ResumableUploader constructor.
public ResumableUploader ( int chunkSize ) : System
chunkSize int the upload chunksize in Megabytes, needs to be greater than 0
Résultat System

Resume() public méthode

public Resume ( Authenticator authentication, Uri resumeUri, String httpMethod, Stream payload, string contentType ) : WebResponse
authentication Authenticator
resumeUri System.Uri
httpMethod String
payload Stream
contentType string
Résultat System.Net.WebResponse

ResumeAsync() public méthode

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
Résultat void

Update() public méthode

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
Résultat System.Net.WebResponse

Update() public méthode

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
Résultat System.Net.WebResponse

UpdateAsync() public méthode

public UpdateAsync ( Authenticator authentication, AbstractEntry payload, object userData ) : void
authentication Authenticator
payload AbstractEntry
userData object
Résultat void

UpdateAsync() public méthode

public UpdateAsync ( Authenticator authentication, Uri resumableUploadUri, Stream payload, string contentType, object userData ) : void
authentication Authenticator
resumableUploadUri System.Uri
payload Stream
contentType string
userData object
Résultat void

UploadStream() public méthode

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
Résultat System.Net.WebResponse

Property Details

CreateMediaRelation public_oe static_oe property

The relationship value to be used to find the resumable
public static string CreateMediaRelation
Résultat string

EditMediaRelation public_oe static_oe property

public static string EditMediaRelation
Résultat string