SilverHoodCorp / gdata-java-client

Automatically exported from code.google.com/p/gdata-java-client
Apache License 2.0
0 stars 0 forks source link

Resource Not found exception. #314

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.I am trying to download mp3 file that is on gdoc from a servlet.
2.For this the export url producing exception of resourcenotfound

What is the expected output? What do you see instead?
I am expecting that this would download the file on local system but exception 
is thrown.

What version of the product are you using? On what operating system?
gdata-client library that is gdata.java-1.41.4 on Windows xp pack 2.

Please provide any additional information below.

What will be the URL for download mp3 files from Google documents.
Plz tell me.
Following is the code snippet.

for (DocumentListEntry entry : documentListFeed.getEntries()) {

if (entry.getTitle().getPlainText().equals("mp3")) {
System.out.println("the selected file is for download 
is...."+entry.getTitle().getPlainText()+ "resource id..." + 
entry.getResourceId());
String resourceId=entry.getResourceId();
String docId1=entry.getDocId();
System.out.println("the docid1...."+docId1+"whether equals or 
not......"+resourceId.equals(docId1));  String docId = 
docId1.substring(docId1.lastIndexOf(":") + 1);
String 
exportUrl="https://docs.google.com/feeds/download/documents/Export?docId=" + 
docId + "&exportFormat=" + 
"mp3";              downloadFile(entry.getTitle().getPlainText(),exportUrl)
}
}

The exception produced by this....

com.google.gdata.util.ResourceNotFoundException: Not Found
<HTML>
<HEAD>
<TITLE>Not Found</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Not Found</H1>
<H2>Error 404</H2>
</BODY>
</HTML>

at 
com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataReque
st.java:587)
at 
com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataR
equest.java:563)
at 
com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.jav
a:550)
at 
com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
at 
com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:
535)
at 
com.google.gdata.client.media.MediaService.getMediaResource(MediaService.java:23
4)
at com.google.gdata.client.media.MediaService.getMedia(MediaService.java:276)
at com.google.gdata.client.media.MediaService.getMedia(MediaService.java:302)
at GdocServlet.downloadFile(GdocServlet.java:137)
at GdocServlet.doPost(GdocServlet.java:118)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
75)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)

Original issue reported on code.google.com by sapna.vi...@gmail.com on 29 Oct 2010 at 7:18