CmisSync.Lib.Cmis.UiUtils.CmisUtils.GetSubfolderTree C# (CSharp) Метод

GetSubfolderTree() статический публичный Метод

Get the sub-folders of a particular CMIS folder.
static public GetSubfolderTree ( CmisRepoCredentials credentials, string path, int depth ) : NodeTree
credentials CmisSync.Lib.Config.CmisRepoCredentials
path string
depth int
Результат NodeTree
        static public NodeTree GetSubfolderTree(CmisRepoCredentials credentials, string path, int depth) {
            // Connect to the CMIS repository.
            Dictionary<string, string> cmisParameters = GetCmisParameters(credentials);
            SessionFactory factory = SessionFactory.NewInstance();
            ISession session = factory.CreateSession(cmisParameters);

            // Get the folder.
            IFolder folder;
            try {
                folder = (IFolder)session.GetObjectByPath(path);
            } catch (Exception ex) {
                Logger.Warn(string.Format("CmisUtils | exception when session GetObjectByPath for {0}: {1}", path, Utils.ToLogString(ex)));
                throw;
            }

            // Debug the properties count, which allows to check whether a particular CMIS implementation is compliant or not.
            // For instance, IBM Connections is known to send an illegal count.
            Logger.Info("CmisUtils | folder.Properties.Count:" + folder.Properties.Count.ToString());
            try {
                IList<ITree<IFileableCmisObject>> trees = folder.GetFolderTree(depth);
                return new NodeTree(trees, folder, depth);
            } catch (Exception e) {
                Logger.Info("CmisUtils getSubFolderTree | Exception " + e.Message, e);
                throw;
            }
        }
    }