Discuss this help topic in SecureBlackbox Forum

Clouds: Copy and move folders

To move the folder use TElOneDriveDataStorageObject.Move() method of the folder object, which you want to move. Pass the object that identifies a destination folder as the parameter.

C#:


// get an object for the target folder
TElOneDriveFolder targetFolder = storage.AcquireObject(@...) as TElOneDriveFolder;
Console.WriteLine("Target folder: {0} (id = {1})",
                  targetFolder.Name, targetFolder.ID);

// get an object for the folder to be moved
TElOneDriveFolder folder = storage.AcquireObject(@"...") as TElOneDriveFolder;
Console.WriteLine("Folder: {0} (parent = {1})", folder.Name, folder.ParentID);

// actually, move the folder to the target folder
folder.Move(targetFolder);
Console.WriteLine("Moved: {0} (parent = {1})", folder.Name, folder.ParentID);

// don't forget to release the objects
folder.Release();
targetFolder.Release();

To copy the folder use TElOneDriveDataStorageObject.Copy() method of the folder object, which you want to copy. Pass the object that identifies a destination folder as the parameter. The method returns the object, that corresponds to the newly created folder.

C#:


// get an object for the target folder
TElOneDriveFolder targetFolder = storage.AcquireObject(@...) as TElOneDriveFolder;
Console.WriteLine("Target folder: {0} (id = {1})",
                  targetFolder.Name, targetFolder.ID);

// get an object for the folder to be moved
TElOneDriveFolder folder = storage.AcquireObject(@"...") as TElOneDriveFolder;
Console.WriteLine("Folder: {0} (parent = {1})", folder.Name, folder.ParentID);

// actually, copy the folder to the target folder
TElOneDriveFolder copiedFolder = folder.Copy(targetFolder) as TElOneDriveFolder;
Console.WriteLine("Copied: {0} (parent = {1})",
                  copiedFolder.Name, copiedFolder.ParentID);

// don't forget to release the objects
folder.Release();
copiedFolder.Release();
targetFolder.Release();

How To articles about OneDrive cloud

Discuss this help topic in SecureBlackbox Forum