Open GoogleCodeExporter opened 9 years ago
I have same problem, here is my code:
DocsService myService = new DocsService("my-id-here");
myService.setUserCredentials("my-email", "my-password");
System.out.println("Logged in google: "+myService.getServiceVersion());
URL docsFeedURL = new
URL("http://docs.google.com/feeds/folders/private/full/folder:my-folder-id-here"
);
DocumentListEntry documentEntry = new DocumentListEntry();
documentEntry.setFile(new File("test.txt"), "text/plain");
documentEntry.setTitle(new PlainTextConstruct("test.txt"));
documentEntry = myService.insert(docsFeedURL, documentEntry);
System.out.println("File uploaded: "+documentEntry.getResourceId());
myService.getRequestFactory().setHeader("If-Match", "*");
documentEntry.setMediaSource(new MediaByteArraySource("updated
content".getBytes(),
"text/plain"));
documentEntry.updateMedia(false);
System.out.println("File updated: "+documentEntry.getResourceId());
Here is output:
Logged in google: GDocs-Java/2.0.1 GData-Java/1.35.1(gzip)
File uploaded: document:0AS15q5biv9gkZGdqcms2d3FfMmdwYnpmc2R2
java.lang.UnsupportedOperationException: Media cannot be updated
at com.google.gdata.data.media.MediaEntry.updateMedia(MediaEntry.java:151)
.....
Original comment by ka3a...@gmail.com
on 13 Aug 2009 at 7:01
I'm checking with the Eng team on this. Will get back to you as soon as we
confirm
this issue.
FYI: This forum issue tracker is not monitored actively (with respect to server
side
issues). Please check
http://groups.google.com/group/Google-Docs-Data-APIs?pli=1 for
any known issues, or use that forum for any Documents Data API issues.
Original comment by vbarat...@gmail.com
on 24 Aug 2009 at 5:58
I couldnt reproduce on our end. Can you confirm if this still an issue?
Original comment by vbarat...@gmail.com
on 26 Aug 2009 at 2:18
I'm using the google calendar api and I'm getting the same exception:
java.lang.UnsupportedOperationException: Entry cannot be updated
Is there any update on this?
Original comment by boven....@gmail.com
on 24 Sep 2009 at 5:41
i have similar problem about updating the position of a media in a playlist,
using
gdata-core-1.0:
my code:
String videoEntryUrl = "http://gdata.youtube.com/feeds/api/videos/AWpsOqh8q0M";
VideoEntry videoEntry = service.getEntry(new URL(videoEntryUrl),
VideoEntry.class);
PlaylistEntry playlistEntry = new PlaylistEntry(videoEntry);
service.insert(new URL(playlistUrl), playlistEntry);
playlistEntry.setPosition(0);
playlistEntry.update();
Exception:
Exception in thread "main" java.lang.UnsupportedOperationException: Entry
cannot
be updated
at com.google.gdata.data.BaseEntry.update(BaseEntry.java:613)
Original comment by babulous...@gmail.com
on 12 Mar 2010 at 5:47
Original issue reported on code.google.com by
blpha...@gmail.com
on 13 Aug 2009 at 2:22