Class: LogStash::Outputs::LogstashAzureBlobOutput::WritableDirectoryValidator

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

Overview

a sub class of LogstashAzureBlobOutput validates that the specified tmeporary directory can be accesed with write permission

Class Method Summary collapse

Class Method Details

.valid?(path) ⇒ Boolean

Checks if a path is valid

Parameters:

  • path (String)

    String that represents the path

Returns:

  • (Boolean)


10
11
12
13
14
15
# File 'lib/logstash/outputs/blob/writable_directory_validator.rb', line 10

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