Lurch web app user interface

Class

DropboxFileSystem

A subclass of FileSystem that reads from/writes to the user's Dropbox, but of course only if the user logs in and gives the app access to do so. It implements all the abstract methods of the parent class, but specific to that one storage location. The permissions set in the Dropbox developer portal for the Lurch app are that it will use only the /Apps/Lurch/ subfolder of the user's Dropbox. It is a Dropbox convention that apps that don't need full access to the user's Dropbox use a subfolder of the /Apps/ folder, based on the name of the app in question, such as /Apps/Lurch/.

Dropbox uses filenames and paths, but it also supports file IDs. This first implementation uses only filenames and paths, but support could be added later for file IDs if needed.

Constructor

new DropboxFileSystem()

Source

Methods

has(fileObject) → {Promise}

See the documentation of the has() method in the parent class for the definition of how this method must behave. This implements the requirements specified there for a file system representing the user's Dropbox, as defined at the documentation for this class.

Because this is a flat file system, any file object with a nonempty path member will not exist, regardless of its filename, and will therefore result in a false value being resolved from the promise.

Parameters

  • fileObject Object

    as documented in the FileSystem class

Returns

Source

read(fileObject) → {Promise}

See the documentation of the read() method in the parent class for the definition of how this method must behave. It implements the requirements specified there for a file system based on the user's Dropbox, as defined at the documentation for this class.

Any file object that does not have a .filename member (including the case where the parameter is omitted) will be interpreted as a folder (and if the .path member is omitted, it counts as the root).

Parameters

  • fileObject Object

    as documented in the FileSystem class

Returns

Source