Exemplo n.º 1
0
        public FileInputPipeline(PipelineContext pipelineContext, FileInputConfiguration configuration, FileInfo path, FileState fileState, IEnumerable <IFilter> filters, IEnumerable <IOutputStream> outputs) : base(pipelineContext, filters, outputs)
        {
            this.configuration   = configuration;
            this.path            = path;
            this.fileState       = fileState;
            this.pipelineContext = pipelineContext;

            lastReadPosition = fileState[path.FullName, configuration.Type];

            logger = LogManager.GetCurrentClassLogger();
        }
Exemplo n.º 2
0
        public DirectoryPipeline(FileInputConfiguration configuration, IEnumerable <IOutputStream> outputs, ILogPipeFactory logPipeFactory, FileState fileState)
        {
            this.configuration  = configuration;
            this.outputs        = outputs;
            this.logPipeFactory = logPipeFactory;

            logger = LogManager.GetCurrentClassLogger();

            directory = Path.GetDirectoryName(this.configuration.Path);
            filter    = Path.GetFileName(this.configuration.Path).Trim();

            this.fileState = fileState;

            watcher.Path     = directory;
            watcher.Filter   = filter;
            watcher.Created += FileCreated;
            watcher.Deleted += FileDeleted;

            timer = new Timer(TimerElapssed);
        }