public void Clear()
        {
            var finalPath = FilePathSanitizer.AssureTrailingPathSlash(_dropFolder);

            foreach (var file in Directory.EnumerateFiles(finalPath, "*.idx"))
            {
                File.SetAttributes(file, FileAttributes.Normal);
                File.SetAttributes(GetInfoFileName(file), FileAttributes.Normal);

                File.Delete(file);
                File.Delete(GetInfoFileName(file));
            }
        }
        public IEnumerable <TextIndexingRequest> GetReadyFiles()
        {
            var finalPath = FilePathSanitizer.AssureTrailingPathSlash(_dropFolder);

            foreach (var file in Directory.EnumerateFiles(finalPath, "*.idx"))
            {
                // the index file is marked as indexed by the cache consumer
                if ((File.GetAttributes(file) & FileAttributes.ReadOnly) != 0)
                {
                    continue;
                }

                var infoFile = GetInfoFileName(file);
                if (!File.Exists(infoFile))
                {
                    continue;
                }

                // the info file needs to be marked as readonly to make sure
                // the index file is ready
                if ((File.GetAttributes(infoFile) & FileAttributes.ReadOnly) == 0)
                {
                    continue;
                }

                var info = XDocument.Load(infoFile);
                var ret  = new TextIndexingRequest(
                    info.Root.Attribute("LSI").Value,
                    info.Root.Attribute("RSI").Value,
                    info.Root.Attribute("FriendlyName").Value,
                    info.ToString().GetHashCode().ToString(),
                    new IndexingRequestDetails(CultureInfo.InvariantCulture,
                                               Encoding.Unicode,
                                               info.Root.Attribute("OriginalMimeType").Value,
                                               string.Empty,
                                               string.Empty),
                    p => File.Open(file, FileMode.Open, FileAccess.Read, FileShare.Read)
                    );
                yield return(ret);
            }
        }