public TreeWalkIndexer(IndexerAdapter myReader)
     : base(myReader)
 {
     this.mSettings = myReader;
     if (this.mSettings.GetConfig().IndexFileExt.Contains("html"))
     {
         this.mSettings.GetConfig().IndexFileExt = ".txt";
     }
 }
예제 #2
0
 public List<TreeFile> GetFilesColl(IndexerAdapter settings)
 {
     List<TreeFile> files = new List<TreeFile>();
     files.AddRange(GetFilesColl());
     FilterHelper filter = new FilterHelper(settings);
     foreach (TreeFile f in GetFilesColl())
     {
         if (filter.IsBannedFile(f.GetFilePath()))
         {
             files.Remove(f);
         }
     }
     return files;
 }
 public FilterHelper(IndexerAdapter settings)
 {
     mSettings = settings;
     mBannedFilter = Regex.Split(mSettings.GetConfig().IgnoreFilesList, "\\" + mSettings.GetOptions().IgnoreFilesListDelimiter);
 }
예제 #4
0
        public void SetText(string text)
        {
            Job1 = EDataType.Text;
            TempText = text;

            string ext = ".log";
            if (Directory.Exists(text) && WorkflowConfig.DestConfig.TextUploaders.Contains(TextDestination.FileUploader))
            {
                ext = ".html";
            }
            string fptxt = FileSystem.GetUniqueFilePath(Engine.ConfigWorkflow, Engine.TextDir,
                                                        new NameParser().Convert("%y.%mo.%d-%h.%mi.%s") + ext);
            UpdateLocalFilePath(fptxt);

            if (Directory.Exists(text))
            {
                var settings = new IndexerAdapter();
                settings.LoadConfig(Engine.ConfigOptions.IndexerConfig);
                Engine.ConfigOptions.IndexerConfig.FolderList.Clear();

                settings.GetConfig().SetSingleIndexPath(Path.Combine(Engine.TextDir, Info.FileName));
                settings.GetConfig().FolderList.Add(TempText);

                Indexer indexer = null;
                switch (settings.GetConfig().IndexingEngineType)
                {
                    case IndexingEngine.TreeLib:
                        indexer = new TreeWalkIndexer(settings);
                        break;
                    case IndexingEngine.TreeNetLib:
                        indexer = new TreeNetIndexer(settings);
                        break;
                }

                if (indexer != null)
                {
                    Job3 = JobLevel3.IndexFolder;
                    TempText = indexer.IndexNow(IndexingMode.IN_ONE_FOLDER_MERGED, false);
                    UpdateLocalFilePath(settings.GetConfig().GetIndexFilePath());
                }
            }
            else if (FileSystem.IsValidLink(text))
            {
                Job3 = JobLevel3.ShortenURL;
            }
            else
            {
                Job3 = JobLevel3.UploadText;
            }
        }
 public Indexer(IndexerAdapter settings)
 {
     mSettings = settings;
 }