Class: LogStash::Setting::ExistingFilePath

Inherits:
LogStash::Setting show all
Defined in:
lib/logstash/settings.rb

Instance Attribute Summary

Attributes inherited from LogStash::Setting

#default, #name

Instance Method Summary collapse

Methods inherited from LogStash::Setting

#==, #reset, #set, #set?, #strict?, #to_hash, #validate_value, #value

Constructor Details

#initialize(name, default = nil, strict = true) ⇒ ExistingFilePath

Returns a new instance of ExistingFilePath.



379
380
381
382
383
384
385
386
387
# File 'lib/logstash/settings.rb', line 379

def initialize(name, default=nil, strict=true)
  super(name, ::String, default, strict) do |file_path|
    if !::File.exists?(file_path)
      raise ::ArgumentError.new("File \"#{file_path}\" must exist but was not found.")
    else
      true
    end
  end
end