TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
10
3.6k
How to create folders and subfolders using Rackspace cloud?
Jan 22 2013 7:40 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;
}
}
public void SaveObjectToCloudfiles(string ContainerName, string FileName, string LocalFilePath)
{
try
{
var container = new CF_Container(CFConnection, CFClient, ContainerName);
var obj = new CF_Object(CFConnection, container, CFClient, FileName);
obj.WriteFromFile(LocalFilePath + @"\" + FileName);
}
catch (Exception ex)
{
throw ex;
}
}
public void CreateContainerAndSaveFiles(string ContainerName, string FileName, string LocalFilePath)
{
CreateContainer(ContainerName);
SaveObjectToCloudfiles(ContainerName, FileName, LocalFilePath);
}
Reply
Answers (
0
)
Job Scheduler
business models enabled through the use of cloud?