久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用帶有 Java 的 Google Drive API,如何僅列出 Driv

Using Google Drive API with Java, how to list only files in the Drive Section/Folder(使用帶有 Java 的 Google Drive API,如何僅列出 Drive Section/Folder 中的文件)
本文介紹了使用帶有 Java 的 Google Drive API,如何僅列出 Drive Section/Folder 中的文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試獲取 Google Drive 特定部分(驅動器部分)中的所有文件.

I am trying to get all files that are in a specific section of Google Drive (The Drive Section).

這些是我正在尋找的文件:

Those are the files I am looking for:

您可以看到一個名為 Projet 3 的文件夾和一個名為 Processus TP2 questions 的文件.在文件夾中我只有一個文件.

You can see a folder named Projet 3 and a file named Processus TP2 questions. In the folder I only have one file.

但是當我嘗試列出所有文件時,我得到了數千個文件.如果我使用 Google Drive 頂部的搜索欄搜索它們,它會找到它們,但我不知道它們在哪里(可能是 Gmail 附件?).

But when I try to list all the files, I get thousands of files. If I search for them using the search bar on top of Google Drive, it finds them, but I have no idea where they are (maybe Gmail attachement?).

這是我的搜索查詢:

FileList result = service.files().list()?    
    .setQ("mimeType != 'application/vnd.google-apps.folder' 
            and trashed = false")?    
    .setSpaces("drive")
    .setFields("nextPageToken, files(id, name, parents)")
    .setPageToken(pageToken)?    
    .execute();

如何僅列出我可以在網絡 UI 上的驅動器部分/文件夾中看到的文件?

How can I list only the files I can see in my Drive Section/Folder on the web UI?

非常感謝.

推薦答案

在查詢中使用parents"屬性,如下所示:

Use "parents" property in your query, like this:

FileList result = service.files().list()?    
.setQ("'root' in parents and mimeType != 'application/vnd.google-apps.folder' and trashed = false")?    
.setSpaces("drive")
.setFields("nextPageToken, files(id, name, parents)")
.setPageToken(pageToken)?    
.execute();

如果您想列出特定文件夾的內容而不是根目錄 - 在查詢中使用該文件夾的 ID 而不是根目錄".

If you want to list the contents of a specific folder rather than root - use that folder's id instead of 'root' in the query.

這篇關于使用帶有 Java 的 Google Drive API,如何僅列出 Drive Section/Folder 中的文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
主站蜘蛛池模板: 99热这里都是精品 | 日日夜夜精品视频 | 精品久久久久久久久久 | 欧美一区二区网站 | 久久综合久久自在自线精品自 | 欧美精品一区二区在线观看 | 欧美天堂一区 | 日韩视频1 | 亚洲第1页 | 国产探花在线精品一区二区 | www.日韩| 精品av天堂毛片久久久借种 | 99re99| 成人在线免费av | 国产精品色av | 三级在线视频 | 久久成人一区 | 日韩免费 | 国产高清一区二区 | 一区二区在线免费观看 | 午夜资源 | 欧美午夜精品久久久久免费视 | 在线看片国产 | 国产在线播放av | 久久国产区 | 国产一区二区三区四区在线观看 | 国产99久久 | 男人的天堂在线视频 | 国产永久免费 | 亚洲精品在线视频 | 成人精品在线观看 | 成人免费小视频 | 欧美日韩一区在线 | 亚洲国产精品人人爽夜夜爽 | 成年人在线观看 | 久久久精品综合 | 全免费a级毛片免费看视频免 | 粉色午夜视频 | 色网在线观看 | 欧美日韩电影免费观看 | 欧美精品一区二区三区在线播放 |