J'ai été tellement frustré par google API. Chaque fois que j'essaie, ça ne marche pas même après avoir ramassé des tonnes de pots d'ici et d'ailleurs. Je serais vraiment reconnaissant si quelqu'un peut me aider avec le morceau ci-dessous code ->Impossible d'exécuter google gdata api pour google docs
import java.net.URL;
import com.google.gdata.client.docs.DocsService;
import com.google.gdata.data.docs.DocumentListEntry;
import com.google.gdata.data.docs.DocumentListFeed;
public class TestGoogleDocs {
public static void main(String[] args) {
try {
System.err.println("== Testing Google Docs ==");
DocsService docService = new DocsService("Document list");
docService.setUserCredentials("*****@gmail.com", "******");
URL documentFeedURL = new URL("http://docs.google.com/feeds/documents/private/full");
DocumentListFeed docsFeed = docService.getFeed(documentFeedURL, DocumentListFeed.class);
for(DocumentListEntry entry: docsFeed.getEntries()){
System.err.println(entry.getTitle().getPlainText());
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
J'ai ajouté après les fichiers jar dans le classpath:
gdata-client-1.0.jar
gdata-client-meta-1.0.jar
gdata-core-1.0.jar
gdata-media-1.0.jar
gdata-docs-3.0.jar
gdata-docs-meta-3.0.jar
activation.jar
mail.jar
servlet-api.jar
guava-r09.jar
erreur que je reçois est:
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(HttpGDataRequest.java:591)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
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.Service.getFeed(Service.java:1135)
at com.google.gdata.client.Service.getFeed(Service.java:998)
at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:631)
at com.google.gdata.client.Service.getFeed(Service.java:1017)
at com.javainsight.cloud.TestGoogleDocs.main(TestGoogleDocs.java:21)
Merci beaucoup. Cela a résolu mon problème. – user381878