Search code examples
javaapigdata

Error Code @5fa01e33 in Java, Resulting from Access Google API Data


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


Solution

  • 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.