FileDocCategorySizeDatePackage
GDataClient.javaAPI DocAndroid 1.5 API6271Wed May 06 22:41:16 BST 2009com.google.wireless.gdata.client

GDataClient

public interface GDataClient
Interface for interacting with a GData server. Specific platforms can provide their own implementations using the available networking and HTTP stack for that platform.

Fields Summary
Constructors Summary
Methods Summary
public voidclose()
Closes this GDataClient, cleaning up any resources, persistent connections, etc., it may have.

public java.io.InputStreamcreateEntry(java.lang.String feedUrl, java.lang.String authToken, com.google.wireless.gdata.serializer.GDataSerializer entry)
Connects to a GData server (specified by the feedUrl) and creates a new entry. The response from the server is returned as an {@link InputStream}. The caller is responsible for calling {@link InputStream#close()} on the returned {@link InputStream}.

param
feedUrl The feed url where the entry should be created.
param
authToken The authentication token that should be used when creating the entry.
param
entry The entry that should be created.
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.

public QueryParamscreateQueryParams()
Creates a new QueryParams that should be used to restrict the feed contents that are fetched.

return
A new QueryParams.

public voiddeleteEntry(java.lang.String editUri, java.lang.String authToken)
Connects to a GData server (specified by the editUri) and deletes an existing entry.

param
editUri The edit uri that should be used for deleting the entry.
param
authToken The authentication token that should be used when deleting the entry.
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.

public java.lang.StringencodeUri(java.lang.String uri)
URI encodes the supplied uri (using UTF-8).

param
uri The uri that should be encoded.
return
The encoded URI.

public java.io.InputStreamgetFeedAsStream(java.lang.String feedUrl, java.lang.String authToken)
Connects to a GData server (specified by the feedUrl) and fetches the specified feed as an InputStream. The caller is responsible for calling {@link InputStream#close()} on the returned {@link InputStream}.

param
feedUrl The feed that should be fetched.
param
authToken The authentication token that should be used when fetching the feed.
return
An InputStream for the feed.
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.

public java.io.InputStreamgetMediaEntryAsStream(java.lang.String mediaEntryUrl, java.lang.String authToken)
Connects to a GData server (specified by the mediaEntryUrl) and fetches the specified media entry as an InputStream. The caller is responsible for calling {@link InputStream#close()} on the returned {@link InputStream}.

param
mediaEntryUrl The media entry that should be fetched.
param
authToken The authentication token that should be used when fetching the media entry.
return
An InputStream for the media entry.
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.

public java.io.InputStreamupdateEntry(java.lang.String editUri, java.lang.String authToken, com.google.wireless.gdata.serializer.GDataSerializer entry)
Connects to a GData server (specified by the editUri) and updates an existing entry. The response from the server is returned as an {@link InputStream}. The caller is responsible for calling {@link InputStream#close()} on the returned {@link InputStream}.

param
editUri The edit uri that should be used for updating the entry.
param
authToken The authentication token that should be used when updating the entry.
param
entry The entry that should be updated.
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.

public java.io.InputStreamupdateMediaEntry(java.lang.String editUri, java.lang.String authToken, java.io.InputStream mediaEntryInputStream, java.lang.String contentType)
Connects to a GData server (specified by the editUri) and updates an existing media entry. The response from the server is returned as an {@link InputStream}. The caller is responsible for calling {@link InputStream#close()} on the returned {@link InputStream}.

param
editUri The edit uri that should be used for updating the entry.
param
authToken The authentication token that should be used when updating the entry.
param
mediaEntryInputStream The {@link InputStream} that contains the new value of the resource
param
contentType The contentType of the new media entry
throws
IOException Thrown if an io error occurs while communicating with the service.
throws
HttpException if the service returns an error response.
return
The {@link InputStream} that contains the metadata associated with the new version of the media entry.