Guest User

Guest User

  • Tech Writer
  • 10
  • 3.5k

How to Create folders and subfolders using Rackspace Clould?

Jan 22 2013 5:38 AM
I am working on Rackspace cloud files (C#) and I have a
scenario where i need to create sub folders with in
a folder for a specified directory using .net.

Eg: c:\abc\def1\..... and c:\abc\def2\..... so on. Precisely
i need to create multiple sub folders in
a single folder . Please help me with dis...!!!

I have used following code to create folder (root folder).But How
to write the code to create subfolders?


public void CreateContainer(string ContainerName)
        {
            try
            {
                var account = new CF_Account(CFConnection, CFClient);
                var container = new CF_Container(CFConnection, CFClient, ContainerName);
                var list = account.GetContainers(true);

                var IsFound = from objList in list
                              where objList.Name == ContainerName
                              select objList;

                if (IsFound.Count() <= 0)
                {
                    account.CreateContainer(ContainerName);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }