addIgnorePath() public method

Adds a new path to the list of paths, which should be ignored. It has to be a absolute path from the repoID on with a leading slash. Path separator must also be a slash.
public addIgnorePath ( string path ) : void
path string
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Get all the configured info about a synchronized folder.
        /// </summary>
        public RepoInfo GetRepoInfo(string folderName)
        {
            RepoInfo repoInfo = new RepoInfo(folderName, ConfigPath);

            repoInfo.User            = GetFolderAttribute(folderName, "user");
            repoInfo.Password        = GetFolderAttribute(folderName, "password");
            repoInfo.Address         = GetUrlForFolder(folderName);
            repoInfo.RepoID          = GetFolderAttribute(folderName, "repository");
            repoInfo.RemotePath      = GetFolderAttribute(folderName, "remoteFolder");
            repoInfo.TargetDirectory = GetFolderAttribute(folderName, "path");

            double pollinterval = 0;

            double.TryParse(GetFolderAttribute(folderName, "pollinterval"), out pollinterval);
            if (pollinterval < 1)
            {
                pollinterval = 5000;
            }
            repoInfo.PollInterval = pollinterval;

            if (String.IsNullOrEmpty(repoInfo.TargetDirectory))
            {
                repoInfo.TargetDirectory = Path.Combine(FoldersPath, folderName);
            }
            LinkedList <string> ignoredFolders = getIgnoredFolders(folderName);

            foreach (string ignoredFolder in ignoredFolders)
            {
                repoInfo.addIgnorePath(ignoredFolder);
            }
            return(repoInfo);
        }
Ejemplo n.º 2
0
                /// <summary>
                /// Get all the configured info about a synchronized folder.
                /// </summary>
                public RepoInfo GetRepoInfo()
                {
                    // TODO: workaround
                    var localPath = LocalPath.TrimEnd(Path.DirectorySeparatorChar);

                    RepoInfo repoInfo = new RepoInfo(DisplayName, ConfigManager.CurrentConfig.ConfigPath);

                    repoInfo.User     = UserName;
                    repoInfo.Password = new Password();
                    repoInfo.Password.ObfuscatedPassword = ObfuscatedPassword;
                    repoInfo.Address            = RemoteUrl;
                    repoInfo.RepoID             = RepositoryId;
                    repoInfo.RemotePath         = RemotePath;
                    repoInfo.TargetDirectory    = localPath;
                    repoInfo.MaxUploadRetries   = uploadRetries;
                    repoInfo.MaxDownloadRetries = downloadRetries;
                    repoInfo.MaxDeletionRetries = deletionRetries;
                    if (PollInterval < 1)
                    {
                        PollInterval = Config.DEFAULT_POLL_INTERVAL;
                    }
                    repoInfo.PollInterval  = PollInterval;
                    repoInfo.IsSuspended   = IsSuspended;
                    repoInfo.SyncAtStartup = SyncAtStartup;

                    foreach (IgnoredFolder ignoredFolder in IgnoredFolders)
                    {
                        repoInfo.addIgnorePath(ignoredFolder.Path);
                    }

                    if (SupportedFeatures != null && SupportedFeatures.ChunkedSupport != null && SupportedFeatures.ChunkedSupport == true)
                    {
                        repoInfo.ChunkSize         = ChunkSize;
                        repoInfo.DownloadChunkSize = ChunkSize;
                    }
                    else
                    {
                        repoInfo.ChunkSize         = 0;
                        repoInfo.DownloadChunkSize = 0;
                    }
                    if (SupportedFeatures != null && SupportedFeatures.ChunkedDownloadSupport != null && SupportedFeatures.ChunkedDownloadSupport == true)
                    {
                        repoInfo.DownloadChunkSize = ChunkSize;
                    }

                    return(repoInfo);
                }
Ejemplo n.º 3
0
                /// <summary>
                /// Get all the configured info about a synchronized folder.
                /// </summary>
                public RepoInfo GetRepoInfo()
                {
                    RepoInfo repoInfo = new RepoInfo(DisplayName, ConfigManager.CurrentConfig.ConfigPath);

                    repoInfo.User     = UserName;
                    repoInfo.Password = new CmisSync.Auth.CmisPassword();
                    repoInfo.Password.ObfuscatedPassword = ObfuscatedPassword;
                    repoInfo.Address         = RemoteUrl;
                    repoInfo.RepoID          = RepositoryId;
                    repoInfo.RemotePath      = RemotePath;
                    repoInfo.TargetDirectory = LocalPath;
                    if (PollInterval < 1)
                    {
                        PollInterval = Config.DEFAULT_POLL_INTERVAL;
                    }
                    repoInfo.PollInterval = PollInterval;

                    foreach (IgnoredFolder ignoredFolder in IgnoredFolders)
                    {
                        repoInfo.addIgnorePath(ignoredFolder.Path);
                    }
                    return(repoInfo);
                }
Ejemplo n.º 4
0
        /// <summary>
        /// Get all the configured info about a synchronized folder.
        /// </summary>
        public RepoInfo GetRepoInfo(string folderName)
        {
            RepoInfo repoInfo = new RepoInfo(folderName, ConfigPath);

            repoInfo.User = GetFolderAttribute(folderName, "user");
            repoInfo.Password = GetFolderAttribute(folderName, "password");
            repoInfo.Address = GetUrlForFolder(folderName);
            repoInfo.RepoID = GetFolderAttribute(folderName, "repository");
            repoInfo.RemotePath = GetFolderAttribute(folderName, "remoteFolder");
            repoInfo.TargetDirectory = GetFolderAttribute(folderName, "path");
            
            double pollinterval = 0;
            double.TryParse(GetFolderAttribute(folderName, "pollinterval"), out pollinterval);
            if (pollinterval < 1) pollinterval = 5000;
            repoInfo.PollInterval = pollinterval;

            if (String.IsNullOrEmpty(repoInfo.TargetDirectory))
            {
                repoInfo.TargetDirectory = Path.Combine(FoldersPath, folderName);
            }
            LinkedList<string> ignoredFolders = getIgnoredFolders(folderName);
            foreach (string ignoredFolder in ignoredFolders)
            {
                repoInfo.addIgnorePath(ignoredFolder);
            }
            return repoInfo;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new CmisSync synchronized folder.
        /// </summary>
        public void CreateRepository(string name, Uri address, string user, string password, string repository, string remote_path, string local_path,
            List<string> ignoredPaths, bool syncAtStartup)
        {
            repoInfo = new RepoInfo(name, ConfigManager.CurrentConfig.ConfigPath);
            repoInfo.Address = address;
            repoInfo.User = user;
            repoInfo.Password = new Password(password);
            repoInfo.RepoID = repository;
            repoInfo.RemotePath = remote_path;
            repoInfo.TargetDirectory = local_path;
            repoInfo.PollInterval = Config.DEFAULT_POLL_INTERVAL;
            repoInfo.IsSuspended = false;
            repoInfo.LastSuccessedSync = new DateTime(1900, 01, 01);
            repoInfo.SyncAtStartup = syncAtStartup;
            repoInfo.MaxUploadRetries = 2;

            foreach (string ignore in ignoredPaths)
                repoInfo.addIgnorePath(ignore);

            // Check that the CmisSync root folder exists.
            if (!Directory.Exists(ConfigManager.CurrentConfig.FoldersPath))
            {
                Logger.Fatal(String.Format("Fetcher | ERROR - Cmis Default Folder {0} does not exist", ConfigManager.CurrentConfig.FoldersPath));
                throw new DirectoryNotFoundException("Root folder don't exist !");
            }

            // Check that the folder is writable.
            if (!CmisSync.Lib.Utils.HasWritePermissionOnDir(ConfigManager.CurrentConfig.FoldersPath))
            {
                Logger.Fatal(String.Format("Fetcher | ERROR - Cmis Default Folder {0} is not writable", ConfigManager.CurrentConfig.FoldersPath));
                throw new UnauthorizedAccessException("Root folder is not writable!");
            }

            // Check that the folder exists.
            if (Directory.Exists(repoInfo.TargetDirectory))
            {
                Logger.Fatal(String.Format("Fetcher | ERROR - Cmis Repository Folder {0} already exist", repoInfo.TargetDirectory));
                throw new UnauthorizedAccessException("Repository folder already exists!");
            }

            // Create the local folder.
            Directory.CreateDirectory(repoInfo.TargetDirectory);

            // Add folder to XML config file.
            ConfigManager.CurrentConfig.AddFolder(repoInfo);

            // Initialize in the GUI.
            AddRepository(repoInfo);
            FolderListChanged();
        }
Ejemplo n.º 6
0
                /// <summary>
                /// Get all the configured info about a synchronized folder.
                /// </summary>
                public RepoInfo GetRepoInfo()
                {
                    RepoInfo repoInfo = new RepoInfo(DisplayName, ConfigManager.CurrentConfig.ConfigPath);
                    repoInfo.User = UserName;
                    repoInfo.Password = new CmisSync.Auth.CmisPassword();
                    repoInfo.Password.ObfuscatedPassword = ObfuscatedPassword;
                    repoInfo.Address = RemoteUrl;
                    repoInfo.RepoID = RepositoryId;
                    repoInfo.RemotePath = RemotePath;
                    repoInfo.TargetDirectory = LocalPath;
                    if (PollInterval < 1) PollInterval = Config.DEFAULT_POLL_INTERVAL;
                    repoInfo.PollInterval = PollInterval;

                    foreach (IgnoredFolder ignoredFolder in IgnoredFolders)
                    {
                        repoInfo.addIgnorePath(ignoredFolder.Path);
                    }
                    return repoInfo;
                }
Ejemplo n.º 7
0
                /// <summary>
                /// Get all the configured info about a synchronized folder.
                /// </summary>
                public RepoInfo GetRepoInfo()
                {
                    // TODO: workaround
                    var localPath = LocalPath.TrimEnd(Path.DirectorySeparatorChar);

                    RepoInfo repoInfo = new RepoInfo(DisplayName, ConfigManager.CurrentConfig.ConfigPath);
                    repoInfo.User = UserName;
                    repoInfo.Password = new Password();
                    repoInfo.Password.ObfuscatedPassword = ObfuscatedPassword;
                    repoInfo.Address = RemoteUrl;
                    repoInfo.RepoID = RepositoryId;
                    repoInfo.RemotePath = RemotePath;
                    repoInfo.TargetDirectory = localPath;
                    repoInfo.MaxUploadRetries = uploadRetries;
                    repoInfo.MaxDownloadRetries = downloadRetries;
                    repoInfo.MaxDeletionRetries = deletionRetries;
                    if (PollInterval < 1) PollInterval = Config.DEFAULT_POLL_INTERVAL;
                    repoInfo.PollInterval = PollInterval;
                    repoInfo.IsSuspended = IsSuspended;
                    repoInfo.SyncAtStartup = SyncAtStartup;

                    foreach (IgnoredFolder ignoredFolder in IgnoredFolders)
                    {
                        repoInfo.addIgnorePath(ignoredFolder.Path);
                    }

                    if(SupportedFeatures != null && SupportedFeatures.ChunkedSupport != null && SupportedFeatures.ChunkedSupport == true)
                    {
                        repoInfo.ChunkSize = ChunkSize;
                        repoInfo.DownloadChunkSize = ChunkSize;
                    }
                    else
                    {
                        repoInfo.ChunkSize = 0;
                        repoInfo.DownloadChunkSize = 0;
                    }
                    if(SupportedFeatures != null && SupportedFeatures.ChunkedDownloadSupport!=null && SupportedFeatures.ChunkedDownloadSupport == true)
                        repoInfo.DownloadChunkSize = ChunkSize;

                    return repoInfo;
                }
Ejemplo n.º 8
0
        /// <summary>
        /// Create a new CmisSync synchronized folder.
        /// </summary>
        public void StartFetcher(string name, Uri address, string user, string password, string repository, string remote_path, string local_path,
            List<string> ignoredPaths)
        {
            repoInfo = new RepoInfo(name, ConfigManager.CurrentConfig.ConfigPath);
            repoInfo.Address = address;
            repoInfo.User = user;
            repoInfo.Password = password;
            repoInfo.RepoID = repository;
            repoInfo.RemotePath = remote_path;
            repoInfo.TargetDirectory = local_path;
            repoInfo.PollInterval = Config.DEFAULT_POLL_INTERVAL;
            foreach (string ignore in ignoredPaths)
                repoInfo.addIgnorePath(ignore);

            fetcher = new Fetcher(repoInfo, activityListenerAggregator);
            this.FinishFetcher();
        }