1

我正在尝试开发一个 java 函数来通过 Google Docs 检索一个特定文件夹的 id,但是这种语言的文档很差,并且在开发它时遇到了问题。到目前为止,我可以做到这一点,但不工作,它永远不会显示我文件夹的文档 ID

public void findfolder(String folderName) throws MalformedURLException,IOException,ServiceException{

URL feedUrla=new URL("https://docs.google.com/feeds/default/private/full/-/folder");

DocumentQuery query = new DocumentQuery(feedUrl);
query.setTitleQuery(folderName);
query.setTitleExact(true);
DocumentListFeed feed=null;

try {
feed = client.getFeed(query, DocumentListFeed.class);
} catch (IOException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
}

for (DocumentListEntry entry : feed.getEntries()) {
System.out.println(entry.getDocId());
}
}`
4

0 回答 0