Java 中的错误代码 @5fa01e33,因访问 Google API 数据而导致

发布于 2024-12-25 19:03:49 字数 1693 浏览 0 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫以 2025-01-01 19:03:49

这看起来不像错误代码。相反,您打印 DocumentListFeed 对象,该类型没有重写的 toString 方法。您可以使用文档中描述的适当的访问器方法来访问提要的内容。

This does not look like as an error code. Rather you print the DocumentListFeed object which type doesn't have an overridden toString method. You can access the feed's contents with the appropriate accessor methods described in the docs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文