How to Create a Folder in OneDrive?

0

I am using the OndeDrive sdk to perform some tests and I want to know if it is possible to create a folder from my app to OneDrive. Please give me a hand.

    
asked by PowerApp 30.10.2016 в 22:27
source

1 answer

0

Yes, it is possible. Using the SDK you can create the folder within a collection of elements by using the request constructors getDrive , getItems , and getChildren with the create method.

Parameters

| Name | Description |

| ---- | ----------- |

| folderToCreate | The folder you want to create. |

Example:

final String parentId = "0000000000000000000000";
final Item folderToCreate = new Item();
folderToCreate.name = "NewFolder";
folderToCreate.folder = new Folder();

final ICallback<Item> callback = new ICallback<Item> {
    @Override
    public void success(final Item result) {
        Toast.makeText(getActivity(), "Created Folder", Toast.LENGTH_LONG).show();
    }
    ...
    // Handle failure
}

oneDriveClient
    .getDrive()
    .getItems(parentId)
    .getChildren()
    .buildRequest()
    .create(folderToCreate, callback);
    
answered by 31.10.2016 / 09:27
source