Class: LogStash::Outputs::Swift::WritableDirectoryValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/outputs/swift/writable_directory_validator.rb

Class Method Summary collapse

Class Method Details

.valid?(path) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
12
13
# File 'lib/logstash/outputs/swift/writable_directory_validator.rb', line 6

def self.valid?(path)
  begin
    FileUtils.mkdir_p(path) unless Dir.exist?(path)
    ::File.writable?(path)
  rescue
    false
  end
end