Rackspace Cloudfiles Module

API Docs for: 1.0.1
Show:

Object Class

Module: Readme

Methods

cancelDownload

(
  • params
)
Void

Available since 1.0.0

Cancels the downloading of the object.

Parameters:

  • params Object
    • [downloadId] Number optional

      The ID of the download to be cancelled. Optional; if not provided, the last download will be cancelled.

Returns:

Void:

copyTo

(
  • params
)
Void

Available since 1.0.0

Copies an object to another container/object.

Note that even though both the target container and the target object parameters are optional, at least one has to be specified.

Parameters:

  • params Object
    • [container] Container optional

      The target container; defaults to the current container.

    • [containerName] String optional

      The target container name; defaults to the current container.

    • [name] String optional

      The target object name. Defaults to the object's own name.

    • success Function

      Callback to call in case of success. The function receives does not receive any parameters.

    • error Function

      Callback to call in case of error.

Returns:

Void:

download

(
  • params
)
Number

Available since 1.0.0

Initiates the downloading of the object. Returns a download ID number that can be used to cancel the download using the cancelDownload function.

This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • file Ti.File

      The file into which to download the content of the object.

    • [ifMatch] String optional

      A value for the If-Match header defined by RFC-2616.

    • [ifNoneMatch] String optional

      A value for the If-None-Match header defined by RFC-2616.

    • [ifModifiedSince] String optional

      A value for the If-Modified-Since header defined by RFC-2616.

    • [ifUnmodifiedSince] String optional

      A value for the If-Unmodified-Since header defined by RFC-2616.

    • [range] String optional

      A value for the Range header defined by RFC-2616. Cloud Files does not support the full specification for this header, but basic support is provided. See the Rackspace documentation for more detail.

    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

    • [progress] Function optional

      Callback to call to report progress. It has a single float parameter between the values 0.0 and 1.0.

Returns:

Number:

downloadFromCdn

(
  • params
)
Number

Available since 1.0.0

Initiates the downloading of the object from the CDN network. Before you call this method, you need to make sure that the object's container is CDN enabled and that the module knows about this. See the the isCdnEnabled and getCdnMetadata functions for more detail.

Returns a download ID number that can be used to cancel the download using the cancelDownload function.

Parameters:

  • params Object
    • file Ti.File

      The file into which to download the content of this object.

    • success Function

      Callback to call in case of success. The function will receive the downloaded object's metadata as parameter.

    • error Function

      Callback to call in case of error.

    • [progress] Function optional

      Callback to call to report progress. It has a single float parameter between the values 0.0 and 1.0.

Returns:

Number:

getMetadata

(
  • params
)
Void

Available since 1.0.0

Retrieves the metadata associated with this object. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

Returns:

Void:

purge

(
  • params
)
Void

Available since 1.0.0

Purges a CDN object. This is an async call that returns the results in a callback.

Parameters:

  • params Object
    • [emailAddresses] Array of Strings optional

      Email addresses to send the purge announcement to.

    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

Returns:

Void:

toString

() String

Available since 1.0.0

Returns a string representation of this object.

Returns:

String:

updateMetadata

(
  • params
  • {String
)
Void

Available since 1.0.0

Updates the metadata associated with this object. This is an async call that returns the results in a callback.

Note that this function overwrites all existing metadata, including built-in properties such as Delete-At. If you would like to preserve any of these values, query them first and supply them as parameters to this function.

Parameters:

  • params Object
    • [metadata] Object optional

      A dictionary that holds the metadata as key/value pairs.

    • [deleteAt] Date optional

      The date after the object should be deleted.

    • [deleteAfter] Number optional

      The number of seconds after which the object should be deleted.

    • success Function

      Callback to call in case of success.

    • error Function

      Callback to call in case of error.

  • {String Object

    [params.contentType] The object's content type.

Returns:

Void:

Properties

cdnIosUri

String read-only

Available since 1.0.0

The iOS URI of the object if the object's container is CDN enabled as far as the module knows.

Note that the status of the container object in memory does not necessarily reflect the status of the container on the Cloud Files server. See the documentation of the getMetadata and getCdnMetadata methods for more detail on this.

cdnSslUri

String read-only

Available since 1.0.0

The SSL CDN URI of the object if the object's container is CDN enabled as far as the module knows.

Note that the status of the container object in memory does not necessarily reflect the status of the container on the Cloud Files server. See the documentation of the getMetadata and getCdnMetadata methods for more detail on this.

cdnStreamingUri

String read-only

Available since 1.0.0

The streaming URI of the object if the object's container is CDN enabled as far as the module knows.

Note that the status of the container object in memory does not necessarily reflect the status of the container on the Cloud Files server. See the documentation of the getMetadata and getCdnMetadata methods for more detail on this.

cdnUri

String read-only

Available since 1.0.0

The CDN URI of the object if the object's container is CDN enabled as far as the module knows.

Note that the status of the container object in memory does not necessarily reflect the status of the container on the Cloud Files server. See the documentation of the getMetadata and getCdnMetadata methods for more detail on this.

container

Container read-only

Available since 1.0.0

The container of the object.

contentType

String read-only

Available since 1.0.0

The content type of the object.

Call the getMetadata function to refresh this property.

deleteAt

NSDate read-only

Available since 1.0.0

The "delete-at" date associated with the object.

Call the getMetadata function to refresh this property.

eTag

String read-only

Available since 1.0.0

The eTag of the object.

Call the getMetadata function to refresh this property.

hash

String read-only

Available since 1.0.0

The hash of the object.

lastModified

Date read-only

Available since 1.0.0

The date and time of last modification.

metadata

Dictionary read-only

Available since 1.0.0

The metadata associated with the object.

Call the getMetadata function to refresh this property.

name

String read-only

Available since 1.0.0

The name of the object.

size

Number read-only

Available since 1.0.0

The size of the object in bytes.