private void init(BasePath path, Scanner scanner) { this.scanner = scanner; Path = path; if (Manager.Threads > 0) slots = Manager.Threads; Files = new ArrayList(); Directories = new List<Directory>(); Directory d; if ((d = Manager.GetDirectory(Path.Name)) == null) { d = new Directory(); d.Name = ""; d.ShortName = ""; d.FullName = Path.Name; d.BasePathId = Path.Id; if (d.Save()) Manager.Directories.Add(d); else { Log.Warning("Unable to save root dir {0} to directories!\n", Path.Name); } } Directories.Add(d); crawl(Path.Name); }
/// <summary> /// Disposes the object /// </summary> public void Dispose() { Path = null; Files.Clear(); Files = null; Directories.Clear(); Directories = null; }
public Indexer(BasePath path, Scanner scanner, bool recurse) { Log.Debug("Indexer with recursion: {0}\n", recurse); this.recurse = recurse; init(path, scanner); }
/// <summary> /// Contructor /// </summary> /// <param name="path"> /// A <see cref="System.String"/> /// </param> /// <param name="scanner"></param> public Indexer(BasePath path, Scanner scanner) { init(path, scanner); }
/// <summary> /// Constructor /// </summary> /// <param name="file"> /// A <see cref="FileInfo"/> /// </param> /// <param name="mediatype"> /// A <see cref="MediaType"/> /// </param> /// <param name="basepath"> /// A <see name="BasePath" /> /// </param> public CrawlerFile(FileInfo file, MediaType mediatype, BasePath basepath) { File = file; MediaType = mediatype; BasePath = basepath; }