Beispiel #1
0
        public IEnumerable <object> GetData(CrawlJobData jobData)
        {
            var filesystemcrawlJobData = jobData as FileSystemCrawlJobData;

            if (filesystemcrawlJobData == null)
            {
                yield break;
            }

            var client = _clientFactory.CreateNew(filesystemcrawlJobData);

            //crawl data from provider and yield objects

            foreach (var computerInfo in client.GetComputerInfo())
            {
                yield return(computerInfo);
            }

            foreach (var item in filesystemcrawlJobData.StartingPoints)
            {
                var info = new DirectoryInfo(item.EntryPoint);

                CrawlDirectory(info, item.CrawlOptions, filesystemcrawlJobData);
            }
        }
Beispiel #2
0
        public override async Task <AccountInformation> GetAccountInformation(ExecutionContext context, [NotNull] CrawlJobData jobData, Guid organizationId, Guid userId, Guid providerDefinitionId)
        {
            if (jobData == null)
            {
                throw new ArgumentNullException(nameof(jobData));
            }

            var filesystemCrawlJobData = jobData as FileSystemCrawlJobData;

            if (filesystemCrawlJobData == null)
            {
                throw new Exception("Wrong CrawlJobData type");
            }

            var client = _filesystemClientFactory.CreateNew(filesystemCrawlJobData);

            return(await Task.FromResult(client.GetAccountInformation()));
        }