private int CreateFolder(DocumentService docSrv, string folderpath)
{
String[] foldernames;
char[] delimiterChars = { '/' };
foldernames = folderpath.Split('/');
String thisPath = "";
Folder filefolder;
Folder thisfolder;
thisfolder = docSrv.GetFolderRoot();
foreach (String foldername in foldernames)
{
if (foldername == "$")
{
thisfolder = docSrv.GetFolderRoot();
thisPath = "$";
}
else
{
thisPath += "/";
thisPath += foldername;
try
{
filefolder = docSrv.GetFolderByPath(thisPath);
}
catch
{
//Console.WriteLine("Creating folder " + thisPath);
filefolder = docSrv.AddFolder(foldername, thisfolder.Id, thisfolder.IsLib);
}
thisfolder = filefolder;
}
}
return 0;
}