Google Drive SDK v2(Android)中的文件是否有“文件路径”? [英] Is there 'file path' for files in Google Drive SDK v2 (Android)?

查看:147
本文介绍了Google Drive SDK v2(Android)中的文件是否有“文件路径”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Google云端硬盘中(在浏览器中),我可以看到文件结构 - 文件和文件夹。在Drive SDK v2(Android)中,我无法看到文件的任何路径属性。那么我怎样才能插入文件在特定的文件夹,因为插入()方法没有路径参数?我如何检查特定文件夹中的文件存在等?这意味着该文件可以有几个父母?

任何给定的文件,这既是你如何添加一个文件到一个文件夹,也是查询一个文件在哪个文件夹。



一个文件可以在多个文件夹中请注意,如果删除某个文件夹,该文件夹中的所有文件都将被删除,即使这些文件也存在于其他文件夹中。

/ p>

In my Google Drive (in browser f.e.) i can see file structure - files and folders. In Drive SDK v2 (Android) i can't see any path property for the file. So how can i insert file in specific folder since insert() method does not have path parameter? how can i check file existence in specific folder and so on? what does it mean the file can have few parents?

解决方案

Use the parents property which provides an array of parent 'folders" for any given file. This is both how you add a file to a folder and also query which folder a file is in.

A file can be in more than one folder simply by having multiple parents.

Be careful that if you delete a folder, all of the files in that folder will be deleted, even if they also exist in other folders.

这篇关于Google Drive SDK v2(Android)中的文件是否有“文件路径”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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