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

Google Drive SDK API沒有列出java中Google Drive上傳的文

Google Drive SDK API does not lists the file uploaded by Google Drive in java(Google Drive SDK API沒有列出java中Google Drive上傳的文件)
本文介紹了Google Drive SDK API沒有列出java中Google Drive上傳的文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在創建一個可以將文件插入 Google Drive 并列出它的應用程序.我正在使用 Google Drive SDK v2 API.但我的問題是它沒有列出不是通過我的應用程序上傳的文件.如果我直接從 Google 驅動器上傳,它不會在我的應用程序中列出.

I am creating an application which can insert files into Google Drive and lists it. I am using Google Drive SDK v2 API. But my problem is it is not listing files which is not uploaded through my application. If I upload directly from Google drive it is not listed in my application.

列出文件的方法如下:

private static List<File> retrieveAllFiles(Drive service) throws IOException {
        List<File> result = new ArrayList<File>();
        Files.List request = service.files().list();

        do {
          try {
            FileList files = request.execute();

            result.addAll(files.getItems());
            request.setPageToken(files.getNextPageToken());
          } catch (IOException e) {
            System.out.println("An error occurred: " + e);
            request.setPageToken(null);
          }
        } while (request.getPageToken() != null &&
                 request.getPageToken().length() > 0);

        return result;
      }

我正在迭代這樣的文件:

and I am iterating files like this :

List<File> files = retrieveAllFiles(service);
        for(File f : files) {
            System.out.println("File Name : "+f.getOriginalFilename();
        }

誰能幫幫我?在此先感謝...

Can anyone help me please ? Thanks in advance ...

推薦答案

我認為你使用了錯誤的 oauth 范圍,可能是 https://www.googleapis.com/auth/drive.file當您應該使用 https://www.googleapis.com/auth/drive 來完全控制您的應用時,這會限制您的應用訪問您的應用創建或打開的文件.

I think you are using the wrong oauth scope, probably https://www.googleapis.com/auth/drive.file which restrict your app's access to file created or opened by your app, when you should use https://www.googleapis.com/auth/drive which gives full control to your app.

這篇關于Google Drive SDK API沒有列出java中Google Drive上傳的文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 示例中缺少)
主站蜘蛛池模板: 国产成人免费在线 | 亚洲人成在线观看 | 夜夜夜夜夜夜曰天天天 | 日韩毛片网 | 亚洲在线一区 | 91玖玖| 一区中文| 免费在线观看一级毛片 | 99re在线免费视频 | 精品一区二区在线观看 | 色欧美综合| 亚洲国产精品成人综合久久久 | 国产一区二区精 | 伊人久久综合 | 第一区在线观看免费国语入口 | 国产精品一区在线观看 | 亚洲国产一区二区三区在线观看 | 亚洲成人黄色 | 99亚洲精品 | 欧美精品久久一区 | 国产成人一区二区三区 | 日韩成人专区 | 欧美不卡 | 国产精品久久久久久久久久久久午夜片 | 成年免费大片黄在线观看一级 | 婷婷色国产偷v国产偷v小说 | 日韩欧美在线一区二区 | 亚洲 欧美 精品 | 高清亚洲 | 亚洲激精日韩激精欧美精品 | 国产精品欧美一区二区三区不卡 | 久久精品国产一区 | 精品少妇一区二区三区在线播放 | 欧美午夜影院 | 97热在线 | 免费在线观看一级毛片 | 亚洲永久| 狠狠色香婷婷久久亚洲精品 | 欧日韩在线观看 | 欧美在线国产精品 | 午夜久久久|