Example #1
0
        /// <summary>
        /// Returns all existing file objects into the repository
        /// </summary>
        public DiscoveredObject[] GetObjects()
        {
            var exclusions = new string[] { $"{_path.RemoveTail()}\\{Constants.Hive}", $"{_path.RemoveTail()}\\{Constants.Bin}" };
            var files      = DirectoryDiscover.GetAllFiles(_path, exclusions, Logger);

            files.ForEach(f =>
            {
                f.DirectoryName = f.DirectoryName.Replace(_path, "").PrefixBackslash();
                f.FullName      = f.FullName.Replace(_path, "").PrefixBackslash();
            });

            return(files.ToArray());
        }
        /// <summary>
        /// Send all modified files to the repository destination
        /// </summary>
        private bool SynchronizeFiles()
        {
            Logger.WriteLog(ErrorCodes.SyncPhase_SendingBegun,
                            ErrorResources.SyncPhase_SendingBegun, Severity.Information, VerboseLevel.User, true);

            var exclusions = new string[]
            {
                $"{_pathNoTail}\\.smk-meta",
                $"{_pathNoTail}\\_smk-bin"
            };

            bool result = new DirectoryDiscover(_path, this, Logger, exclusions).Run();

            Logger.WriteLog(ErrorCodes.SyncPhase_SendingEnded,
                            ErrorResources.SyncPhase_SendingEnded, Severity.Information, VerboseLevel.User, true);

            return(result);
        }