public static List<Node> CreateNodesFromLocalFolder(string path, Node parent)
{
string[] subdirs = Directory.GetDirectories(path);
List<Node> results = new List<Node>();
foreach (string subdir in subdirs)
{
Folder f = new Folder()
{
Name = new DirectoryInfo(subdir).Name,
Parent = parent,
LocationType = Node.NodeLocationType.LOCAL
};
if(f.Parent.Path.EndsWith("/"))
f.Path = f.Parent.Path + f.Name ;
else
f.Path = f.Parent.Path + "/" + f.Name ;
f.IsIllegalFileNameInPath = CmisSync.Lib.Utils.IsInvalidFolderName(f.Name, ConfigManager.CurrentConfig.IgnoreFolderNames);
List<Node> children = CreateNodesFromLocalFolder(subdir, f);
foreach (Node child in children)
f.Children.Add(child);
results.Add(f);
}
return results;
}