Raa*_*Raa 2 android google-drive-api
我正在尝试从我的Android应用程序上传文件,我能够.但在此之前,我想查看Google云端硬盘上的可用空间.
我正在使用Google Drive API(版本2).我尝试了多个选项,但无法找到该信息.
有人可以告诉我如何获取Google云端硬盘的免费空间.
看看这个伟大的样本:文档
private static void printAbout(Drive service) {
try {
About about = service.about().get().execute();
System.out.println("Current user name: " + about.getName());
System.out.println("Root folder ID: " + about.getRootFolderId());
System.out.println("Total quota (bytes): " + about.getQuotaBytesTotal());
System.out.println("Used quota (bytes): " + about.getQuotaBytesUsed());
// TOTAL - USED = FREE SPACE
} catch (IOException e) {
System.out.println("An error occurred: " + e);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1722 次 |
| 最近记录: |