Class: CPEE::DStore::DoGet

Inherits:
Riddl::Implementation
  • Object
show all
Defined in:
lib/cpee-dstore/implementation.rb

Overview

{{{

Instance Method Summary collapse

Instance Method Details

#responseObject



28
29
30
31
32
33
34
35
36
37
# File 'lib/cpee-dstore/implementation.rb', line 28

def response
  file = File.join(@a[0],@r[-2],@r[-1])
  meta = file + '.mimetype'
  if File.exist?(file) && File.exist?(meta)
    Riddl::Parameter::Complex.new('file',File.read(meta).strip,File.open(file,'rb'))
  else
    @status = 404
    nil
  end
end