Class Fog::Storage::Rackspace::File
In: lib/fog/rackspace/models/storage/file.rb
Parent: Fog::Model

Methods

Attributes

directory  [RW]  @!attribute [r] directory @return [Fog::Storage::Rackspace::Directory] directory containing file
public  [W]  @!attribute [w] public @note Required for compatibility with other Fog providers. Not Used.

Public Instance methods

Returns the body/contents of 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] @example Retrieve and download contents of Cloud Files object to file system

  file_object = directory.files.get('germany.jpg')
  File.open('germany.jpg', 'w') {|f| f.write(file_object.body) }

@see Fog::Storage::Rackspace::Files#get

Sets the body/contents of file @param [String,File] new_body contents of file

Copy file to another directory or directory @param [String] target_directory_key @param [String] target_file_key @param options [Hash] used to pass in file attributes @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/Copy_Object-d1e2241.html

Destroy the file @return [Boolean] returns true if file is destroyed @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/Delete_Object-d1e2264.html

URL used to stream video to iOS devices without needing to convert your video @return [String] iOS URL @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/iOS-Streaming-d1f3725.html

Set last modified @param [String, Fog::Time] obj

Set file metadata @param [Hash,Fog::Storage::Rackspace::Metadata] hash contains key value pairs

Required for compatibility with other Fog providers. Not Used.

Is file published to CDN @return [Boolean] return true if published to CDN @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]

Returns the public url for the file. If the file has not been published to the CDN, this method will return nil as it is not publically accessible. This method will return the approprate url in the following order:

  1. If the service used to access this file was created with the option :rackspace_cdn_ssl => true, this method will return the SSL-secured URL.
  2. If the directory‘s cdn_cname attribute is populated this method will return the cname.
  3. return the default CDN url.

@return [String] public url for 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]

Immediately purge file from the CDN network @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 You may only PURGE up to 25 objects per day. Any attempt to purge more than this will result in a 498 status code error (Rate Limited). @see docs.rackspace.com/files/api/v1/cf-devguide/content/Purge_CDN-Enabled_Objects-d1e3858.html

Create or updates file and associated metadata @param options [Hash] additional parameters to pass to Cloud 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/Create_Update_Object-d1e1965.html

URL used to stream resources @return [String] streaming url @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/Streaming-CDN-Enabled_Containers-d1f3721.html

Get a url for file.

    required attributes: key

@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

[Validate]