删除机器人/垃圾文件使用android.gms.drive [英] Delete / trash file from android using android.gms.drive

查看:178
本文介绍了删除机器人/垃圾文件使用android.gms.drive的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用 com.google.android.gms.drive 从谷歌驱动器删除文件。从我读过<一个href="http://stackoverflow.com/questions/21369573/trash-delete-in-new-google-drive-android-api">here和网络上出现了新的API的文件删除不支持。 是(仍然)是否正确?我的意思是这个API是不是新的了...

I need to delete files from Google Drive using com.google.android.gms.drive. From what I've read here and across the web there is no support for file deletion in the "new API". Is that (still) correct? I mean the API isn't that new anymore ...

我也读到了明确的内容和忘记-strategy,但我想不会效仿这种做法。

I also read about the "clear contents and forget"-strategy, but I'd like not to follow that approach.

问题的第2部分:的考虑,它仍然无法通过上述API来删除文件;没有任何的轻松的方式向 REST API 结合W¯¯ /在code我已经写?类似于

Part 2 of the question: Given it's still impossible to delete files via the API mentioned above; is there any easy way to combine the REST API w/ the code I've already written? Something like

  1. 得到GoogleApiClient令牌
  2. 在火灾DELETE请求瓦特/令牌和文件ID
  3. ???
  4. 利润

编辑:新的谷歌游戏服务(版本7.0.0 2015年/ 3月)终于拥有垃圾桶()方法。见的https://developer.android.com/reference/com/google/android/gms/drive/DriveResource.html对于进一步的细节。


edit: The new Google Play Services (version 7.0.0 / March 2015) finally features a trash() method. See https://developer.android.com/reference/com/google/android/gms/drive/DriveResource.html for further details. .

EDIT2:显然,你无法从应用文件夹,使用垃圾桶()上的文件无法垃圾应用程序文件夹或文件的应用程序文件夹内:((

edit2: Apparently you cannot use trash() on files from the app folder: Cannot trash App Folder or files inside the App Folder. :((

EDIT3:截至5月28日,它现在可以真正<一个href="https://developers.google.com/android/reference/com/google/android/gms/drive/DriveResource#delete%28com.google.android.gms.common.api.GoogleApiClient%29"相对=nofollow>删除文件。

edit3: As of May 28th, it's now possible to actually delete files.

推荐答案

删除是支持的谷歌推动Android API作为谷歌的使用Play业务7.5 <一href="https://developers.google.com/android/reference/com/google/android/gms/drive/DriveResource#delete(com.google.android.gms.common.api.GoogleApiClient)"相对=nofollow> DriveResource.delete()方法。

Delete is supported by the Google Drive Android API as of Google Play services 7.5 using the DriveResource.delete() method.

删除是永久性的,并建议只对应用程序文件夹的内容,这里的垃圾是不可用的。

Delete is permanent, and recommended only for App Folder content, where trash is not available.

这篇关于删除机器人/垃圾文件使用android.gms.drive的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆