class Fog::Storage::Aliyun::Directories

Public Instance Methods

all() click to toggle source
# File lib/fog/aliyun/models/storage/directories.rb, line 10
def all
  containers = service.get_containers
  return nil if nil == containers
  data = []
  i = 0
  containers.each do |entry|
    key = entry['Prefix'][0]
    key[-1] = ''
    data[i] = { key: key }
    i += 1
  end

  load(data)
end
get(key, options = {}) click to toggle source
# File lib/fog/aliyun/models/storage/directories.rb, line 25
def get(key, options = {})
  if !key.nil? && key != '' && key != '.'
    dir = key + '/'
    ret = service.head_object(dir, options)
    new(key: key) if ret.data[:status] == 200
  else
    new(key: '')
  end
rescue Fog::Storage::Aliyun::NotFound
  nil
end