Retrieving a single document entry using the Java client library


The snippet below demonstrates how to retrieve a single DocumentListEntry using the Java client library:
import java.net.URL;

import com.google.gdata.client.docs.DocsService;
import com.google.gdata.data.docs.DocumentListEntry;

public class DocumentListGetEntry {

  public static void main(String[] args) {
    try {
      DocsService docsService = new DocsService("Document List Demo");
      docsService.setUserCredentials("foobar@example.com", "secret");
   
      URL documentURI = new URL("http://docs.google.com/feeds/documents/private/full/spreadsheet%3Apc6ppXdYxYkSSOvE8tCUELw");
      DocumentListEntry entry = docsService.getEntry(documentURI, DocumentListEntry.class);
   
      System.out.println(entry.getTitle().getPlainText());  
  
    } catch (Exception e) {
      System.err.println(e.toString());
    }
  }
}