Class Fog::Storage::Rackspace::Files
In: lib/fog/rackspace/models/storage/files.rb
Parent: Fog::Collection

Methods

all   each   file_url   get   get_http_url   get_https_url   get_url   head   new  

External Aliases

each -> each_file_this_page
  Calls block for each file in the directory @yieldparam [Fog::Storage::Rackspace::File] @return [Fog::Storage::Rackspace::Directory] returns itself @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404 @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400 @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500 @raise [Fog::Storage::Rackspace::ServiceError] @note This method retrieves files in pages. Page size is defined by the limit attribute

Public Class methods

Returns an escaped object url @param [String] path of the url @param [String] key of the object @return [String] escaped file url

Public Instance methods

Returns list of files @return [Fog::Storage::Rackspace::Files] Retrieves a list files. @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404 @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400 @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500 @raise [Fog::Storage::Rackspace::ServiceError] @see docs.rackspace.com/files/api/v1/cf-devguide/content/List_Objects-d1e1284.html

Retrieves file @param [String] key of file @yield get yields to block after chunk of data has been received (Optional) @yieldparam [String] data @yieldparam [Integer] remaining @yieldparam [Integer] content_length @return [Fog::Storage::Rackspace:File] @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404 @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400 @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500 @raise [Fog::Storage::Rackspace::ServiceError] @note If a block is provided, the body attribute will be empty. By default chunk size is 1 MB. This value can be changed by passing the parameter :chunk_size

  into the :connection_options hash in the service constructor.

@example Download an image from Cloud Files and save it to file

  File.open('download.jpg', 'w') do | f |
    my_directory.files.get("europe.jpg") do |data, remaing, content_length|
      f.syswrite data
    end
  end

@see docs.rackspace.com/files/api/v1/cf-devguide/content/Retrieve_Object-d1e1856.html

Get a temporary http url for a file.

required attributes: key @param key [String] the key of the file within the directory @param expires [String] number of seconds (since 1970-01-01 00:00) before url expires @param options [Hash] @return [String] url @note This URL does not use the Rackspace CDN

Get a temporary https url for a file.

required attributes: key @param key [String] the key of the file within the directory @param expires [String] number of seconds (since 1970-01-01 00:00) before url expires @param options [Hash] @return [String] url @note This URL does not use the Rackspace CDN

Returns the public_url for the given object key @param key of the object @return [String] url for object @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404 @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400 @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500 @raise [Fog::Storage::Rackspace::ServiceError] @see Directory#public_url

View directory detail without loading file contents @param key of the object @param options Required for compatibility with other Fog providers. Not Used. @return [Fog::Storage::Rackspace::File] @raise [Fog::Storage::Rackspace::NotFound] - HTTP 404 @raise [Fog::Storage::Rackspace::BadRequest] - HTTP 400 @raise [Fog::Storage::Rackspace::InternalServerError] - HTTP 500 @raise [Fog::Storage::Rackspace::ServiceError]

Create a new file object @param [Hash] attributes of object @return [Fog::Storage::Rackspace::File]

[Validate]