从Google文档列表Api中的路径获取FileEntry(gdata-java-client)

时间:2012-06-22 22:28:53

标签: java google-docs gdata

如何从其路径中获取Google Docs FileEntry?

从Google文档中的条目中获取路径后,例如:

https://doc-04-20-docs.googleusercontent.com/docs/secure/m71240U1?h=1630126&e=download&gd=true

如何在以后获取相应的FileEntries?

1 个答案:

答案 0 :(得分:0)

在经过身份验证的DocsService上调用getEntry方法。

String rootUrl = "https://docs.google.com/feeds/default/private/full";
String path = //file entry's id
FileEntry entry = _service.getEntry(new URL(rootUrl + "/" + URLEncoder.encode(path, "UTF-8")), FileEntry.class);