Java 中的错误代码 @5fa01e33,因访问 Google API 数据而导致
我在java编程方面遇到了麻烦。这个java正在调用Google API,它为我提供GData访问权限,
当它查询某些查询时我遇到了麻烦,结果是@5fa01e33。这是我的代码:
package com.thegroovie;
import java.net.URL;
import javax.swing.JOptionPane;
import com.google.gdata.client.DocumentQuery;
import com.google.gdata.client.docs.DocsService;
import com.google.gdata.data.docs.DocumentListEntry;
import com.google.gdata.data.docs.DocumentListFeed;
public class GDataExample {
public static void main(String[] args) {
String username = JOptionPane.showInputDialog(null,"Input Username");
String password = JOptionPane.showInputDialog(null,"Input Password");
try{
DocsService service = new DocsService("Document List demo");
service.setProtocolVersion(DocsService.Versions.V3);
service.setUserCredentials(username, password);
URL documentListFeedUrl = new
URL("https://docs.google.com/feeds/default/private/full");
DocumentListFeed feed = service.getFeed(documentListFeedUrl, DocumentListFeed.class);
for(DocumentListEntry entry : feed.getEntries()){
System.out.println(entry.getTitle().getPlainText());
}
System.out.println("*******************************");
String input_query = JOptionPane.showInputDialog(null,"Search : ");
DocumentQuery query = new DocumentQuery(documentListFeedUrl);
query.setFullTextQuery(input_query);
DocumentListFeed feeds = service.getFeed(query, DocumentListFeed.class);
System.out.print(feeds);
}
catch (Exception ex){
System.err.println("Exception "+ ex.getMessage());
}
}
}
如何解决这个问题?
谢谢
i'm having trouble with java programming. This java is calling Google API which provide me with GData access
I'm having trouble when it's querying some query, resulting @5fa01e33. This is my code:
package com.thegroovie;
import java.net.URL;
import javax.swing.JOptionPane;
import com.google.gdata.client.DocumentQuery;
import com.google.gdata.client.docs.DocsService;
import com.google.gdata.data.docs.DocumentListEntry;
import com.google.gdata.data.docs.DocumentListFeed;
public class GDataExample {
public static void main(String[] args) {
String username = JOptionPane.showInputDialog(null,"Input Username");
String password = JOptionPane.showInputDialog(null,"Input Password");
try{
DocsService service = new DocsService("Document List demo");
service.setProtocolVersion(DocsService.Versions.V3);
service.setUserCredentials(username, password);
URL documentListFeedUrl = new
URL("https://docs.google.com/feeds/default/private/full");
DocumentListFeed feed = service.getFeed(documentListFeedUrl, DocumentListFeed.class);
for(DocumentListEntry entry : feed.getEntries()){
System.out.println(entry.getTitle().getPlainText());
}
System.out.println("*******************************");
String input_query = JOptionPane.showInputDialog(null,"Search : ");
DocumentQuery query = new DocumentQuery(documentListFeedUrl);
query.setFullTextQuery(input_query);
DocumentListFeed feeds = service.getFeed(query, DocumentListFeed.class);
System.out.print(feeds);
}
catch (Exception ex){
System.err.println("Exception "+ ex.getMessage());
}
}
}
How to resolve this?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这看起来不像错误代码。相反,您打印
DocumentListFeed
对象,该类型没有重写的toString
方法。您可以使用文档中描述的适当的访问器方法来访问提要的内容。This does not look like as an error code. Rather you print the
DocumentListFeed
object which type doesn't have an overriddentoString
method. You can access the feed's contents with the appropriate accessor methods described in the docs.