public ClientBrand(ServerCredentials credentials, string repositoryId, string remoteFolderPath)
            {
                Dictionary <string, string> parameters = CmisUtils.GetCmisParameters(credentials);
                ISessionFactory             factory    = SessionFactory.NewInstance();
                IList <IRepository>         repos      = factory.GetRepositories(parameters);

                foreach (IRepository repo in repos)
                {
                    if (repo.Id == repositoryId)
                    {
                        this.repository = repo;
                        this.repoName   = repo.Name;
                    }
                }

                if (this.repository == null)
                {
                    throw new ArgumentException("No such repository for " + repositoryId);
                }

                this.session = this.repository.CreateSession();
                this.folder  = this.session.GetObjectByPath(remoteFolderPath) as IFolder;
                if (this.folder == null)
                {
                    throw new ArgumentException("No such folder for " + remoteFolderPath);
                }

                foreach (string name in this.nameList)
                {
                    this.pathList.Add((remoteFolderPath + "/" + name).Replace("//", "/"));
                }

                this.DeleteFiles();
                this.CreateFiles();
            }
        private IRepository GetRepo(ServerCredentials credentials)
        {
            Dictionary <string, string> parameters = CmisUtils.GetCmisParameters(credentials);

            try {
                ISessionFactory     factory = SessionFactory.NewInstance();
                IList <IRepository> repos   = factory.GetRepositories(parameters);
                foreach (IRepository repo in repos)
                {
                    if (repo.Name == this.RepoName)
                    {
                        return(repo);
                    }
                }

                return(null);
            } catch (Exception e) {
                Logger.Debug(e.Message);
                return(null);
            }
        }