Method: Bcms::WebDAV::Resource#get

Defined in:
lib/bcms_webdav/resource.rb

#get(request, response) ⇒ Object



124
125
126
127
128
129
130
131
132
133
# File 'lib/bcms_webdav/resource.rb', line 124

def get(request, response)
  # log "GET request for #{request.path}"
  if have_file
    path_to_file = @resource.data.path
    # log "For attachment '#{@resource}' path to file is '#{path_to_file}"
    file = Bcms::WebDAV::File.new(path_to_file)
    log "Sending file '#{path_to_file}'"
    response.body = file
  end
end