Class: LogStash::Setting::WritableDirectory

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 = false) ⇒ WritableDirectory

Returns a new instance of WritableDirectory.



391
392
393
394
395
396
397
398
399
# File 'lib/logstash/settings.rb', line 391

def initialize(name, default=nil, strict=false)
  super(name, ::String, default, strict) do |path|
    if ::File.directory?(path) && ::File.writable?(path)
      true
    else
      raise ::ArgumentError.new("Path \"#{path}\" is not a directory or not writable.")
    end
  end
end