API Docs for: 0.8.2
Show:

ItemDriver Class

An item utility interacts with the item storage and is responsible for creating and deleting items. This is an implementation of item utility using Dropbox as the item storage.

For ItemMirror core developers only. Enable protected to see.

Constructor

ItemDriver

(
  • options
)
protected

Parameters:

  • options Object

    Data to construct a new ItemU with

    • utilityURI String

      URI of the utility

    • dropboxClient Object

      Authenticated dropbox client

Methods

checkExisted

(
  • path
  • name
  • callback(result)
)
protected

Check if the item is existed

Parameters:

  • path String

    the path to the location that the item is located

  • name String

    the name of the item

  • callback(result) Function

    Function to be called when self function is finished with it's operation. Result is the bollean value for whether existed.

copyItem

(
  • fromPath
  • toPath
  • callback
)
protected

Copies an item in the fashion of moveItem

Parameters:

  • fromPath String

    the path to the file you want copied

  • toPath String

    the GroupingItem path you want the fromPath file copied to

  • callback Function

    Function to be called when self function is finished with it's operation.

createGroupingItem

(
  • path
  • callback
)
protected

Creates a grouping item at the location

Parameters:

  • path String

    the path to the location that the grouping item will be created

  • callback Function

    Function to be called when self function is finished with it's operation.

createNonGroupingItem

(
  • path
  • file
  • callback
)
protected

Creates or uploads a non-grouping item at the location

Parameters:

  • path String

    the path to the location that the non-grouping item will be created

  • file String

    the contents to be written to the non-grouping item

  • callback Function

    Function to be called when self function is finished with it's operation.

deleteGroupingItem

(
  • path
  • callback
)
protected

Deletes a grouping item at the location

Parameters:

  • path String

    the path to the location that the grouping item is located

  • callback Function

    Function to be called when self function is finished with it's operation.

deleteNonGroupingItem

(
  • path
  • name
  • callback
)
protected

Deletes a non-grouping item at the location

Parameters:

  • path String

    the path to the location that the non-grouping item is located

  • name String

    the name of the non-grouping item

  • callback Function

    Function to be called when self function is finished with it's operation.

getURL

(
  • path
  • callback
)
protected

Get publicly readable download url for a non-grouping item from Dropbox website.

Parameters:

  • path String

    the path to the location that the non-grouping item is located

  • callback Function

    Function to be called when self function is finished with it's operation.

listItems

(
  • path
  • callback(output)
)
protected

Lists the items under the grouping item

Parameters:

  • path String

    the path to the grouping item

  • callback(output) Function

    Function to be called when self function is finished with it's operation. Output is an array of AssociationEditors.

moveItem

(
  • fromPath
  • toPath
  • callback
)
protected

Moves an item

Parameters:

  • fromPath String

    the path to the file you want moved

  • toPath String

    the GroupingItem path you want the fromPath file moved

  • callback Function

    Function to be called when self function is finished with it's operation.