在采用了android Onedrive创建目录采用了、目录、android、Onedrive

2023-09-04 02:59:59 作者:傾城少年

我使用的是Microsoft liveSDK为Android在5月份申请。我使用的文件夹创建follwing方法。

Hi I am using Microsoft liveSDK for android in may application. I am using follwing method for folder creation.

LiveOperation postAsync(字符串路径,JSONObject的身体,LiveOperationListener监听器)

LiveOperation postAsync(String path, JSONObject body, LiveOperationListener listener)

我需要在Onedrive。我创建目录(文件夹结构)有absoute路径(如:A / B / C),若A / B已经存在,我要创建文件夹B文件夹内C(不想Overwirte)。有什么方法可用于这一目的。

I need to create directory(folder structure) in Onedrive .I have absoute path(eg: A/B/C).If A/B is already exist, I want to create folder C inside folder B(dont want to Overwirte). Have any method is available for this purpose

感谢

推荐答案

在LiveSDK不支持创建一个文件夹路径的层次结构。你需要创建一个文件夹,获得其ID,然后该路径下创建子文件夹树。

The LiveSDK does not support creating a folders path hierarchy. You'd need to create a folder, get its id, and then create the tree of sub-folders under that path.

有一个OneDrive API,它不支持此功能,请 https://dev.onedrive.com/ ,它允许基于两个路径查找,和路径层次的创作。

There is a OneDrive API that does support this functionality, https://dev.onedrive.com/, which allows for both path based lookup, and path hierarchy creation.

要创建一个文件夹工艺类似如下的请求,在这个例子中,我们将在一个请求中创建的文件夹层次的 A> B> C> D>电子

To create a folder craft a request like the following, in this example we will create the folder hierarchy a > b > c > d > e in a single request.

POST https://api.onedrive.com/v1.0/drive/root:/a/b/c/d:/children
Content-Type: application/json

{
    "name":"e",
    "folder":{}
}