CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder.Connect C# (CSharp) Method

Connect() public method

Connect to the CMIS repository.
public Connect ( ) : void
return void
            public void Connect()
            {
                // Create session.
                session = Auth.Auth.GetCmisSession(repoInfo.Address.ToString(), repoInfo.User, repoInfo.Password.ToString(), repoInfo.RepoID);
                Logger.Debug("Created CMIS session: " + session.ToString());
                
                // Detect repository capabilities.
                ChangeLogCapability = session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All
                        || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.ObjectIdsOnly;
                IsGetDescendantsSupported = session.RepositoryInfo.Capabilities.IsGetDescendantsSupported == true;
                IsGetFolderTreeSupported = session.RepositoryInfo.Capabilities.IsGetFolderTreeSupported == true;
                
                //repoInfo.CmisProfile.contentStreamFileNameOrderable = session.RepositoryInfo.Capabilities. TODO

                Config.SyncConfig.Folder folder = ConfigManager.CurrentConfig.GetFolder(this.repoInfo.Name);
                if (folder != null)
                {
                    Config.Feature features = folder.SupportedFeatures;
                    if (features != null)
                    {
                        if (IsGetDescendantsSupported && features.GetDescendantsSupport == false)
                            IsGetDescendantsSupported = false;
                        if (IsGetFolderTreeSupported && features.GetFolderTreeSupport == false)
                            IsGetFolderTreeSupported = false;
                        if (ChangeLogCapability && features.GetContentChangesSupport == false)
                            ChangeLogCapability = false;
                        if (ChangeLogCapability && session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.All 
                            || session.RepositoryInfo.Capabilities.ChangesCapability == CapabilityChanges.Properties)
                            IsPropertyChangesSupported = true;
                    }
                }
                Logger.Debug("ChangeLog capability: " + ChangeLogCapability.ToString());
                Logger.Debug("Get folder tree support: " + IsGetFolderTreeSupported.ToString());
                Logger.Debug("Get descendants support: " + IsGetDescendantsSupported.ToString());
                if (repoInfo.ChunkSize > 0)
                {
                    Logger.Debug("Chunked Up/Download enabled: chunk size = " + repoInfo.ChunkSize.ToString() + " byte");
                }
                else
                {
                    Logger.Debug("Chunked Up/Download disabled");
                }
                HashSet<string> filters = new HashSet<string>();
                filters.Add("cmis:objectId");
                filters.Add("cmis:name");
                if (!CmisUtils.IsDocumentum(session))
                {
                    filters.Add("cmis:contentStreamFileName");
                    filters.Add("cmis:contentStreamLength");
                }
                filters.Add("cmis:lastModificationDate");
                filters.Add("cmis:lastModifiedBy");
                filters.Add("cmis:path");
                filters.Add("cmis:changeToken"); // Needed to send update commands, see https://github.com/aegif/CmisSync/issues/516
                session.DefaultContext = session.CreateOperationContext(filters, false, true, false, IncludeRelationshipsFlag.None, null, true, null, true, 100);
            }