Java 如何使用分页检索Google文档?

Java 如何使用分页检索Google文档?,java,google-docs,google-docs-api,Java,Google Docs,Google Docs Api,我希望通过使用Java客户端库进行分页来接收google文档信息。 我的代码: 到 我得到了两个相同的条目。我发现了如何实现这个问题: 对于其他服务,它也是以同样的方式实现的。您能发布整个代码片段吗? private static final String URL_STRING = "https://docs.google.com/feeds/default/private/full/"; public List<DocumentListEntry> getAllDocs() t

我希望通过使用Java客户端库进行分页来接收google文档信息。 我的代码:


我得到了两个相同的条目。

我发现了如何实现这个问题:


对于其他服务,它也是以同样的方式实现的。

您能发布整个代码片段吗?
private static final String URL_STRING = "https://docs.google.com/feeds/default/private/full/";

public List<DocumentListEntry> getAllDocs() throws Exception {
    URL feedUri = new URL(URL_STRING);
    DocumentQuery query = new DocumentQuery(feedUri);
    query.setMaxResults(2);
    query.setStartIndex(1);
    DocumentListFeed feed = client.getFeed(query, DocumentListFeed.class);
    return feed.getEntries();
}
List<DocumentListEntry> docList = gDocumentsRetriever.getAllDocs();
for (DocumentListEntry entry : docList) {
    processEntry(oAuthToken, gDocumentsRetriever, entry);
}
query.setStartIndex(1);
query.setStartIndex(3);