DownloadStream


Description:

[ CCode ( has_construct_function = false , type = "GInputStream*" ) ]
[ Version ( since = "0.9.0" ) ]
public DownloadStream (Service service, AuthorizationDomain? domain, string download_uri, Cancellable? cancellable = null)

Creates a new DownloadStream, allowing a file to be downloaded from a GData service using standard InputStream API.

As well as the standard GIO errors, calls to the InputStream API on a DownloadStream can also return any relevant specific error from ServiceError, or PROTOCOL_ERROR in the general case.

If a Cancellable is provided in cancellable, the download operation may be cancelled at any time from another thread using cancel. In this case, any ongoing network activity will be stopped, and any pending or future calls to InputStream API on the DownloadStream will return CANCELLED. Note that the Cancellable objects which can be passed to individual InputStream operations will not cancel the download operation proper if cancelled — they will merely cancel that API call. The only way to cancel the download operation completely is using this cancellable .

Parameters:

service

a Service

domain

the AuthorizationDomain to authorize the download, or null

download_uri

the URI to download; this must be HTTPS

cancellable

a Cancellable for the entire download stream, or null

Returns:

a new InputStream, or null; unref with unref