Methods Summary |
---|
public com.google.wireless.gdata.data.Entry | createEntry(java.lang.String feedUrl, java.lang.String authToken, com.google.wireless.gdata.data.Entry entry)Creates a new entry at the provided feed. Parses the server response
into the version of the entry stored on the server.
GDataSerializer serializer = gDataParserFactory.createSerializer(entry);
InputStream is = gDataClient.createEntry(feedUrl, authToken, serializer);
return parseEntry(entry.getClass(), is);
|
public QueryParams | createQueryParams()Creates {@link QueryParams} that can be used to restrict the feed
contents that are fetched.
return gDataClient.createQueryParams();
|
public void | deleteEntry(java.lang.String editUri, java.lang.String authToken)Deletes an existing entry.
gDataClient.deleteEntry(editUri, authToken);
|
public com.google.wireless.gdata.data.Entry | getEntry(java.lang.Class entryClass, java.lang.String id, java.lang.String authToken)Fetches an existing entry.
InputStream is = getGDataClient().getFeedAsStream(id, authToken);
return parseEntry(entryClass, is);
|
protected GDataClient | getGDataClient()Returns the {@link GDataClient} being used by this GDataServiceClient.
return gDataClient;
|
protected GDataParserFactory | getGDataParserFactory()Returns the {@link GDataParserFactory} being used by this
GDataServiceClient.
return gDataParserFactory;
|
public java.io.InputStream | getMediaEntryAsStream(java.lang.String mediaEntryUrl, java.lang.String authToken)Fetches a media entry as an InputStream. The caller is responsible for closing the
returned {@link InputStream}.
return gDataClient.getMediaEntryAsStream(mediaEntryUrl, authToken);
|
public com.google.wireless.gdata.parser.GDataParser | getParserForFeed(java.lang.Class feedEntryClass, java.lang.String feedUrl, java.lang.String authToken)Fetches a feed for this user. The caller is responsible for closing the
returned {@link GDataParser}.
InputStream is = gDataClient.getFeedAsStream(feedUrl, authToken);
return gDataParserFactory.createParser(feedEntryClass, is);
|
public abstract java.lang.String | getServiceName()Returns the name of the service. Used for authentication.
|
private com.google.wireless.gdata.data.Entry | parseEntry(java.lang.Class entryClass, java.io.InputStream is)
GDataParser parser = null;
try {
parser = gDataParserFactory.createParser(entryClass, is);
return parser.parseStandaloneEntry();
} finally {
if (parser != null) {
parser.close();
}
}
|
public com.google.wireless.gdata.data.Entry | updateEntry(com.google.wireless.gdata.data.Entry entry, java.lang.String authToken)Updates an existing entry. Parses the server response into the version
of the entry stored on the server.
String editUri = entry.getEditUri();
if (StringUtils.isEmpty(editUri)) {
throw new ParseException("No edit URI -- cannot update.");
}
GDataSerializer serializer = gDataParserFactory.createSerializer(entry);
InputStream is = gDataClient.updateEntry(editUri, authToken, serializer);
return parseEntry(entry.getClass(), is);
|
public com.google.wireless.gdata.data.MediaEntry | updateMediaEntry(java.lang.String editUri, java.io.InputStream inputStream, java.lang.String contentType, java.lang.String authToken)Updates an existing entry. Parses the server response into the metadata
of the entry stored on the server.
if (StringUtils.isEmpty(editUri)) {
throw new IllegalArgumentException("No edit URI -- cannot update.");
}
InputStream is = gDataClient.updateMediaEntry(editUri, authToken, inputStream, contentType);
return (MediaEntry)parseEntry(MediaEntry.class, is);
|