Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DropboxFileSystem

A read/write file system backed by Dropbox cloud storage.

Uses the Dropbox V1 API.

NOTE: You must use the v0.10 version of the Dropbox JavaScript SDK.

Hierarchy

Implements

Index

Constructors

constructor

  • Deprecated. Please use Dropbox.Create() method instead.

    Constructs a Dropbox-backed file system using the authenticated DropboxJS client.

    Note that you must use the old v0.10 version of the Dropbox JavaScript SDK.

    Parameters

    • client: Client
    • Default value deprecateMsg: boolean = true

    Returns DropboxFileSystem

Methods

_makeFile

  • Private Returns a BrowserFS object representing a File, created from the data returned by calls to the Dropbox API.

    Parameters

    • path: string
    • flag: FileFlag
    • stat: Stat
    • buffer: Buffer

    Returns DropboxFile

_remove

  • Private Delete a file or directory from Dropbox isFile should reflect which call was made to remove the it (unlink or rmdir). If this doesn't match what's actually at path, an error will be returned

    Parameters

    Returns void

_statType

  • Private Returns a BrowserFS object representing the type of a Dropbox.js stat object

    Parameters

    • stat: Stat

    Returns FileType

_writeFileStrict

  • _writeFileStrict(p: string, data: ArrayBuffer, cb: BFSCallback<Stat>): void

appendFile

appendFileSync

  • appendFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void

chmod

chmodSync

  • chmodSync(p: string, isLchmod: boolean, mode: number): void

chown

  • chown(p: string, isLchown: boolean, uid: number, gid: number, cb: BFSOneArgCallback): void

chownSync

  • chownSync(p: string, isLchown: boolean, uid: number, gid: number): void

convert

  • convert(err: ApiError, path?: string | null): ApiError
  • Converts a Dropbox-JS error into a BFS error.

    Parameters

    • err: ApiError
    • Default value path: string | null = null

    Returns ApiError

createFile

createFileSync

  • createFileSync(p: string, flag: FileFlag, mode: number): File

diskSpace

  • diskSpace(p: string, cb: function): void

empty

exists

  • exists(p: string, cb: function): void

existsSync

  • existsSync(p: string): boolean

getName

  • getName(): string

isReadOnly

  • isReadOnly(): boolean

link

linkSync

  • linkSync(srcpath: string, dstpath: string): void

mkdir

mkdirSync

  • mkdirSync(p: string, mode: number): void

open

openFile

openFileSync

  • openFileSync(p: string, flag: FileFlag, mode: number): File
  • Opens the file at path p with the given flag. The file must exist.

    Parameters

    • p: string

      The path to open.

    • flag: FileFlag

      The flag to use when opening the file.

    • mode: number

    Returns File

    A File object corresponding to the opened file.

openSync

readFile

  • readFile(fname: string, encoding: string | null, flag: FileFlag, cb: BFSCallback<string | Buffer>): void

readFileSync

  • readFileSync(fname: string, encoding: string | null, flag: FileFlag): any

readdir

  • readdir(path: string, cb: BFSCallback<string[]>): void

readdirSync

  • readdirSync(p: string): string[]

readlink

readlinkSync

  • readlinkSync(p: string): string

realpath

  • realpath(p: string, cache: object, cb: BFSCallback<string>): void

realpathSync

  • realpathSync(p: string, cache: object): string

rename

renameSync

  • renameSync(oldPath: string, newPath: string): void

rmdir

rmdirSync

  • rmdirSync(p: string): void

stat

statSync

  • statSync(p: string, isLstat: boolean | null): Stats

supportsLinks

  • supportsLinks(): boolean

supportsProps

  • supportsProps(): boolean

supportsSymlinks

  • supportsSymlinks(): boolean

supportsSynch

  • supportsSynch(): boolean

symlink

  • symlink(srcpath: string, dstpath: string, type: string, cb: BFSOneArgCallback): void

symlinkSync

  • symlinkSync(srcpath: string, dstpath: string, type: string): void

truncate

truncateSync

  • truncateSync(p: string, len: number): void

unlink

unlinkSync

  • unlinkSync(p: string): void

utimes

utimesSync

  • utimesSync(p: string, atime: Date, mtime: Date): void

writeFile

writeFileSync

  • writeFileSync(fname: string, data: any, encoding: string | null, flag: FileFlag, mode: number): void

Static Create

Static isAvailable

  • isAvailable(): boolean

Generated using TypeDoc