@ -8,7 +8,7 @@ class CollectionResourcesService
end
def get_file(file)
@storage_service.get_file_io(file)
@storage_service.get_file(file)
rescue StandardError
nil
@ -7,7 +7,7 @@ module Storage
Dir.entries(path)
def get_file_io(filename)
def get_file(filename)
path = Rails.root.join("tmp/storage", filename)
File.open(path, "r")
@ -31,6 +31,11 @@ module Storage
.body
def get_file(file_name)
@client.get_object(bucket: @configuration.bucket_name, key: file_name)
.body.read
def write_file(file_name, data)
@client.put_object(
body: data,