lib/fog/dtdream/models/storage/files.rb in fog-dtdream-0.0.3 vs lib/fog/dtdream/models/storage/files.rb in fog-dtdream-0.0.5
- old
+ new
@@ -16,18 +16,17 @@
def all(options = {})
requires :directory
if directory.key != "" && directory.key != "." && directory.key != nil
prefix = directory.key+"/"
end
- files = service.list_objects({:prefix => prefix})["Contents"]
+ files = service.list_objects({:prefix => prefix})["ListBucketResult"]["Contents"]
data = Array.new
i = 0
files.each do |file|
- if file["Key"][0][-1] != "/"
- content_length = file["Size"][0].to_i
- key = file["Key"][0]
- key = key[13..-1]
- lastModified = file["LastModified"][0]
+ if file["Key"][-1] != "/"
+ content_length = file["Size"].to_i
+ key = file["Key"]
+ lastModified = file["LastModified"]
if lastModified != nil && lastModified != ""
last_modified = (Time.parse(lastModified)).localtime
else
last_modified = nil
end