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

使用 Google Drive SDK 將文件保存在特定文件夾中

Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
本文介紹了使用 Google Drive SDK 將文件保存在特定文件夾中的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我一直在嘗試將純文本文件保存到 Android 版 Google 云端硬盤中的特定文件夾中.

I've been trying to save a plain text file into a specific folder in Google Drive on Android.

到目前為止,我已經(jīng)能夠在 Google 云端硬盤上使用文檔和 快速入門指南做一些朝著正確方向發(fā)展的事情,首先我能夠創(chuàng)建一個純文本文件:

So far using the Documentation and QuickStart Guide on Google Drive I have been able to do a few things that are going in the right direction, first I was able to create a plain text file:

  File body = new File();
  body.setTitle(fileContent.getName());
  body.setMimeType("text/plain");
  File file = service.files().insert(body, textContent).execute();

我已經(jīng)能夠在 Google Drive 的基本目錄中創(chuàng)建一個新文件夾:

I have been able to create a new folder in the base directory of Google Drive with:

  File body = new File();
  body.setTitle("Air Note");
  body.setMimeType("application/vnd.google-apps.folder");
  File file = service.files().insert(body).execute();

我還能夠列出用戶 Google Drive 帳戶中的所有文件夾:

I have also been able to list all of the folders in the user's Google Drive account with:

      List<File> files = service.files().list().setQ("mimeType = 'application/vnd.google-apps.folder'").execute().getItems();
      for (File f : files) {
          System.out.println(f.getTitle() + ", " + f.getMimeType());
      }

但是,我對如何將文本文件保存到 Google Drive 中的文件夾中有點卡住.

However I am a bit stuck on how to save a text file into a folder within Google Drive.

推薦答案

你需要使用 parent 參數(shù)通過 insert 將文件放入文件夾中.https://developers.google.com/drive/v2/reference/了解更多詳情文件/插入

You need to use the parent parameter to put a file in a folder using insert. More details at https://developers.google.com/drive/v2/reference/files/insert

類似的東西

File body = new File();  
body.setTitle(fileContent.getName());
body.setMimeType("text/plain");
body.setParents(Arrays.asList(new File.ParentReference().setId(parentId));  
File file = service.files().insert(body, textContent).execute();

這篇關(guān)于使用 Google Drive SDK 將文件保存在特定文件夾中的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(fā)(Google 驅(qū)動器 API))
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(谷歌驅(qū)動api服務(wù)賬戶查看上傳文件到谷歌驅(qū)動使用java)
Google Drive service account returns 403 usageLimits(Google Drive 服務(wù)帳號返回 403 usageLimits)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
Check progress for Upload amp; Download (Google Drive API for Android or Java)(檢查上傳和進度下載(適用于 Android 或 Java 的 Google Drive API))
主站蜘蛛池模板: 成人午夜在线 | 欧美中文字幕在线观看 | 欧美一区二区三区视频在线 | 精品视频一区二区三区 | 人人干人人干人人干 | 在线视频成人 | 成人精品一区二区 | 成人在线中文字幕 | 国产成人高清视频 | 国产在线一区二 | 亚洲一区二区在线 | 成人在线免费视频 | 国产在线精品免费 | 成人二区 | 亚洲综合日韩精品欧美综合区 | 天天射天天干 | 91精品国产91久久久久久密臀 | 2020亚洲天堂| 国产精品一区在线 | 欧美日韩高清在线一区 | 青青草视频网 | 亚洲视频在线一区 | 亚洲国产一区在线 | 欧美亚洲视频 | 奇米四色影视 | 日韩国产三区 | 国产96色在线 | 久久成人一区二区三区 | 国产美女精品视频 | 欧美成人一区二区 | 日韩在线欧美 | 不卡的av在线 | h片免费在线观看 | 国产高清在线精品一区二区三区 | 亚洲欧洲成人av每日更新 | 国产精品一区二区不卡 | 国产色婷婷久久99精品91 | 无码国模国产在线观看 | 久久精品亚洲 | 国产福利91精品 | 国产露脸国语对白在线 |