您应该同时使用get和list方法来获取 google drive 文件的详细修订列表;下面的示例应该可以工作(我没有测试过):
/**
* Print detail information about revisions of the specified file.
*
* @param service Drive API service instance.
* @param fileId ID of the file to print revisions for.
*/
private static void detailedRevisions(Drive service, String fileId) {
try {
RevisionList revisions = service.revisions().list(fileId).execute();
List<Revision> revisionList = revisions.getItems();
for(Revision revision : revisionList) {
revision = service.revisions().get(
fileId, revision.getId()).execute();
System.out.println("Revision ID: " + revision.getId());
System.out.println("Modified Date: " + revision.getModifiedDate());
if (revision.getPinned()) {
System.out.println("This revision is pinned");
}
}
} catch (IOException e) {
System.out.println("An error occured: " + e);
}
}
检查此以获取修订类方法的完整列表:
https ://developers.google.com/resources/api-libraries/documentation/drive/v2/java/latest/