VaultFolderCreate.DocumentSvc.DocumentService.GetFolderByPath C# (CSharp) Method

GetFolderByPath() private method

private GetFolderByPath ( string path ) : Folder
path string
return Folder
        public Folder GetFolderByPath(string path) {
            object[] results = this.Invoke("GetFolderByPath", new object[] {
                        path});
            return ((Folder)(results[0]));
        }
        

Usage Example

 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;
 }
DocumentService