如何使用谷歌云端硬盘Android API改变谷歌云端硬盘中创建的文件夹或文件的访问权限? [英] How to change permission of folder or file created in Google Drive using Google Drive Android API?

查看:263
本文介绍了如何使用谷歌云端硬盘Android API改变谷歌云端硬盘中创建的文件夹或文件的访问权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的 谷歌云端硬盘Android API 的存储和共享创建的文件和文件夹。当我使用创建文件/文件夹的 谷歌云端硬盘Android API 的,默认情况下创建的文件或文件夹的私有的(不会对外公开)

当我创建共享任何用户文件/文件夹的链接,用户需要发送的电子邮件请求访问的所有者。所以,车主必须手动进行文件/文件夹公众在谷歌驱动器以prevent访问请求。

When I share the link of file/folder created to any user, that user needs to send email request for access to owner. So owner have to make file/folder public manually in Google Drive to prevent access requests.

在哪里为的 谷歌驱动器的iOS API 的,当创建文件/文件夹,创建文件/文件夹在默认情况下的公共即可。

我要问的另一个问题是,当我查询文件夹列表中的根文件夹(是 MIME_TYPE 应用程序/ vnd.google-apps.folder ),结果与所有文件夹给出。其中,由于使用的 谷歌驱动器的iOS API queryForFilesL​​ist() 只方法返回特定的iOS应用,在根目录并不是所有的文件夹创建的文件夹。

Another question I want to ask is, When I am querying list of folders in Root folder (with MIME_TYPE as application/vnd.google-apps.folder), the result is given with all folders. Where as using Google Drive iOS API, queryForFilesList() method returns only folders created by particular iOS app, not all folders in the root directory.

我必须做的使用来获得这种结果的 谷歌云端硬盘Android API 谷歌驱动器REST API

What I have to do to get this kind of result using Google Drive Android API or Google Drive REST API?

推荐答案

每DaImTo的评论:结果
您可以使用 GDAA 并的 REST 的在一起,我也发表了并排侧CRUD实现的这里这里。你必须知道的一些事情,虽然:

Per DaImTo's comment:
You can use GDAA and REST together, I have a side-by-side CRUD implementations published here and here. You must be aware of a few things, though:

1 /在GDAA连接不与REST参见<的'UserRecoverableAuthIOException的逻辑相一致的href=\"https://github.com/seanpjanson/RESTDemo/blob/master/app/src/main/java/com/andyscan/gdrtdemo/REST.java#L62\"相对=nofollow> 的init()/ <一个href=\"https://github.com/seanpjanson/GDAADemo/blob/master/src/main/java/com/andyscan/gdrtdemo/GDAA.java#L69\"相对=nofollow>中的两个例子连接()组合。其实,你可以使用GDAA的'连接'的逻辑做授权,然后继续使用REST服务。在'UserRecoverableAuthIOException'仍应的情况下,与<一个处理用户混乱href=\"http://stackoverflow.com/questions/30172915/user-disconnecting-app-in-drive-causes-loss-of-data-under-file-scope\">Settings >管理应用程序>断开从硬盘。不过,你的应用程序是DOA无论如何,如果是下的文件范围。

1/ The 'connect' in the GDAA is not aligned with the 'UserRecoverableAuthIOException' logic of the REST See init()/connect() combo in the two examples. Actually, you can use GDAA's 'connect' logic to do the authorization and then continue using the REST service. The 'UserRecoverableAuthIOException' should still be handled in case your user messes with the 'Settings > Manage Apps > Disconnect From Drive'. But then, your app is DOA anyway if it is under the FILE scope.

2 /的GDAA使用驱动器Id作为主要的ID是本地的装置。它具有访问RESOURCEID(有一些延迟),它是在REST的主要标识。该资源ID是一个全系统的编号可以移植到不同的设备,系统等。见<一href=\"http://stackoverflow.com/questions/29030110/cannot-get-folderid-that-i-just-created-on-google-drive/29049474#29049474\">here和<一个href=\"http://stackoverflow.com/questions/22874657/un$p$pdictable-result-of-driveid-getresourceid-in-google-drive-android-api/31553269#31553269\">here.

2/ The GDAA uses DriveId as a primary ID that is local to a device. It has access to the ResourceId (with some latency) that is primary ID in REST. The ResourceID is a system-wide ID that can be ported to different devices, systems. See here and here.

3 /的REST API是更广泛的GDAA是建立在它之上,并且只有一个功能子集(无文本链接的举例)。它仅支持文件范围(相对于驱动器和REST的文件范围)。

3/ The REST API is broader, the GDAA is build on top of it and has only a subset of functionality (no thumbnail link for instance). It supports FILE scope only (as opposed to DRIVE and FILE scopes of the REST).

4 /当你开始2混合在一起,你会接触到延时/定时问题,因为您的应用程序拥有对REST的网络完全控制,而GDAA的同步隐藏着一些依稀记载的sync方法的。

4/ When you start mixing the 2 together, you will be exposed to latency/timing issues, since your app has full control over the REST's networking, whereas GDAA's synchronization is hidden with some vaguely documented sync methods.

如果你看一下GDAA的架构更接近这里(一个驱动文件的生命周期) ,你会找出二者混合均匀的潜在缺陷。

If you look closer at the GDAA's architecture here (Lifecycle of a Drive file) , you will figure out potential pitfalls of mixing the two.

好运

这篇关于如何使用谷歌云端硬盘Android API改变谷歌云端硬盘中创建的文件夹或文件的访问权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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