Doesn't look like it: http://www.google.com/codesearch?q=getMedia+package:http://gdata-java-client\.googlecode\.com&origq=getMedia&btnG=Search+Trunk
<http://www.google.com/codesearch?q=getMedia+package:http://gdata-java-client\.googlecode\.com&origq=getMedia&btnG=Search+Trunk>Are you using an IDE such as Eclipse? I know getMedia() is part of the docliust service class (which inherits from MediaService). Do a search for getMedia() and setMediaSource() in this doc to see examples: http://code.google.com/apis/documents/docs/2.0/developers_guide_java.html Eric On Tue, Jul 14, 2009 at 12:17 AM, Peter <naveen.ven...@gmail.com> wrote: > > Hi Eric, > > I included gdata-media-1.0.jar file in the classpath, and imported > com.google.gdata.data.media.MediaSource; in the java file. > > The error is "cannot find method SetURI() and getMedia() in > MediaContent class". So I just want to confirm if these methods are > removed from > > http://gdata-java-client.googlecode.com/files/gdata-samples.java-1.34.0.zip > > Is there any other way to retrieve the content? > > Naveen. V > > On Jul 14, 12:45 am, Eric Bidelman <api.e...@google.com> wrote: > > Did you include the media jar? > > > > On Mon, Jul 13, 2009 at 9:00 AM, Peter <naveen.ven...@gmail.com> wrote: > > > > > Hi guys, > > > > > I ran into a problem when I try to export document using GData API's. > > > > > I'm using the following Java code to read the contents of the document > > > as a stream. > > > > > [quote] > > > > > String docType = resourceId.substring(0, resourceId.lastIndexOf > > > (':')); > > > String docId = resourceId.substring(resourceId.lastIndexOf > > > (':') + 1); > > > > > URL exportUrl = new URL("http://docs.google.com/feeds/ > > > download/" + docType + "s/Export?docID=" + docId + "&exportFormat=" + > > > format); > > > > > System.out.println("Exporting document from: " + exportUrl); > > > > > MediaContent mc = new MediaContent(); > > > mc.setUri(exportUrl.toString()); > > > MediaSource ms = service.getMedia(mc); > > > > > InputStream inStream = null; > > > FileOutputStream outStream = null; > > > > > try { > > > inStream = ms.getInputStream(); > > > outStream = new FileOutputStream(filepath); > > > > > int c; > > > while ((c = inStream.read()) != -1) { > > > outStream.write(c); > > > } > > > } finally { > > > if (inStream != null) { > > > inStream.close(); > > > } > > > if (outStream != null) { > > > outStream.flush(); > > > outStream.close(); > > > } > > > } > > > > > [/quote] > > > > > When I compile it says > > > > > init: > > > deps-jar: > > > Compiling 1 source file to /home/naveenv/vosrc/connects/zohoconnects/ > > > ZohoConnects/build/classes > > > /home/naveenv/contactnaveen/GetGoogleDocs.java:80: cannot find symbol > > > symbol : method setUri(java.lang.String) > > > location: class com.google.gdata.data.media.mediarss.MediaContent > > > mc.setUri(exportUrl.toString()); > > > /home/naveenv/contactnaveen/GetGoogleDocs.java:81: cannot find symbol > > > symbol : method getMedia > > > (com.google.gdata.data.media.mediarss.MediaContent) > > > location: class com.google.gdata.client.docs.DocsService > > > MediaSource ms = service.getMedia(mc); > > > 2 errors > > > BUILD FAILED (total time: 0 seconds) > > > > > I'm using gdata-samples.java-1.34.0.zip from the following the URL > > > > >http://gdata-java-client.googlecode.com/files/gdata-samples.java-1.34. > .. > > > > > Are the methods removed in the latest zip file? Is there any other way > > > to retrieve the content of the document? > > > Any pointers would be quite helpful. > > > > > TIA > > > > > Naveen. V > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Docs Data APIs" group. To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com To unsubscribe from this group, send email to google-docs-data-apis+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/Google-Docs-Data-APIs?hl=en -~----------~----~----~----~------~----~------~--~---