Class: LogStash::Inputs::DeleteCompletedFileHandler
- Inherits:
-
Object
- Object
- LogStash::Inputs::DeleteCompletedFileHandler
- Defined in:
- lib/logstash/inputs/delete_completed_file_handler.rb
Instance Method Summary collapse
- #handle(path) ⇒ Object
-
#initialize(watch) ⇒ DeleteCompletedFileHandler
constructor
A new instance of DeleteCompletedFileHandler.
Constructor Details
#initialize(watch) ⇒ DeleteCompletedFileHandler
Returns a new instance of DeleteCompletedFileHandler.
5 6 7 |
# File 'lib/logstash/inputs/delete_completed_file_handler.rb', line 5 def initialize(watch) @watch = watch end |
Instance Method Details
#handle(path) ⇒ Object
9 10 11 12 |
# File 'lib/logstash/inputs/delete_completed_file_handler.rb', line 9 def handle(path) Pathname.new(path).unlink rescue nil @watch.watched_files_collection.remove_paths([path]) end |