私はGoogle APIに非常に不満を抱いています。私が試してみるたびに、ちょうどここからの瓶を収集した後でさえも機能しません。誰もが、コードの以下の部分で私を助けることができる場合、私は本当に感謝される - >GoogleのGoogleドキュメントのGoogle gdata APIを実行できません
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();
}
}
}
私はクラスパスに次のjarファイルを追加しました:私は取得しています
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
エラーは次のとおりです。
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)
ありがとうございました!それは私の問題を解決しました。 – user381878