Hello friends. I m developing an Picasa web API application. This time
i m authenticating user,getting list of all albums, inserting a new
album, updating inserted album and deleting that inserted album. While
deleting thatinserted album i m getting an Exception like
com.google.gdata.util.VersionConflictException: Conflict
with XML response. Here is my code :-
protected void authenticate(String u_id, String pass) {
try {
service = new PicasawebService("SilverTouch-Picasa-1.0");
service.setUserCredentials(u_id, pass);
feedUrl = new URL("http://picasaweb.google.com/data/feed/
api/user/" + user_id);
} catch (Exception e) {
e.printStackTrace();
}
}
protected void getAlbum() throws MalformedURLException,
IOException, ServiceException {
album_id = new String[0];
URL getAlbumURL = new URL(feedUrl + "?kind=album");
myUserFeed = service.getFeed(getAlbumURL,
UserFeed.class);
List l = myUserFeed.getAlbumEntries();
Iterator it = l.iterator();
while (it.hasNext()) {
AlbumEntry AE = (AlbumEntry) it.next();
out.write(AE.getId() + "<br/>");
String[] temp = new String[album_id.length + 1];
System.arraycopy(album_id, 0, temp, 0, album_id.length);
temp[album_id.length] = AE.getId().toString();
album_id = temp;
}
out.write("length of an array ->" + album_id.length+"<hr/>");
}
protected void addAlbum(String title, String description) throws
IOException, ServiceException, InterruptedException {
myAlbum = new AlbumEntry();
myAlbum.setTitle(new PlainTextConstruct(title));
myAlbum.setDescription(new PlainTextConstruct(description));
insertedEntry = service.insert(feedUrl, myAlbum);
System.out.println("Album Added successfully");
out.write("Album Added successfully"+"<hr/>");
}
protected void updateAlbum() throws IOException, ServiceException
{
insertedEntry.setDescription(new PlainTextConstruct("Updated
album description"));
insertedEntry.update();
System.out.println("Album Updated successfully");
out.write("Album Updated successfully"+"<hr/>");
}
protected void deleteAlbum() throws IOException, ServiceException,
InterruptedException {
insertedEntry.delete();
System.out.println("Album Deleted successfully");
out.write("<b>Album Deleted successfully</b>");
}
Can any one help me where's the problem?
Thanks in advance
Pratik
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Picasa Web Albums API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Picasa-Data-API?hl=en
-~----------~----~----~----~------~----~------~--~---