[英]Get childrens files from an ID folder in Google Drive
我正在嘗試從父文件夾中獲取所有文件/文件夾。
我設法獲得了父文件夾的ID。 當我嘗試獲取文件信息時,如果我使用此頁面實時示例中所示的ID,則可以: https : //developers.google.com/drive/v2/reference/files/get
但是,當我嘗試使用頁面代碼示例獲取任何文件數據時:
try {
File file = service.files().get(fileId).execute();
System.out.println("Title: " + file.getTitle());
System.out.println("Description: " + file.getDescription());
System.out.println("MIME type: " + file.getMimeType());
} catch (IOException e) {
System.out.println("An error occured: " + e);
}
}
除了得到此錯誤消息外,我什么也沒得到:
com.google.api.client.googleapis.json.GoogleJsonResponseException:404確定
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "File not found: 0Bz8fRNYAOdjjd05ydVRCROE4QlE",
"reason" : "notFound"
} ],
"message" : "File not found: 0Bz8fRNYAOdjjd05ydVRCROE4QlE"
}
如何從具有ID的文件/文件夾中獲取任何數據?
預先非常感謝和問候!
404表示(1)ID錯誤,或(2)您無權訪問該文件夾。
要確認ID,請在https://developers.google.com/drive/v2/reference/files/get#try-it上使用“嘗試”,並查看是否可以檢索該文件。
如果可行,請檢查您的應用所使用的用戶和范圍是否允許訪問。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.