Class: GdfsUi

GdfsUi(The, The)

new GdfsUi(The, The)

class GdfsUi

Parameters:
Name Type Description
The HTMLElement

root element that UI widget will be built.

The Gdfs

gapi client.

Source:

Methods

chdirById(folderId) → {Promise.<undefined>}

Move current directory to root, parent or one of children.

Parameters:
Name Type Description
folderId string

A destination file id to move. To move to parent, ".." is available.

Source:
Returns:
Type
Promise.<undefined>

getCurrentPath() → {Array.<string>}

Get current path as full path.

Source:
Returns:

The array of file ids.

Type
Array.<string>

(async) getFileResource(fileId) → {Promise.<object>}

Get file resource.

Parameters:
Name Type Description
fileId string

The file id of the target file.

Source:
Returns:

The resource object.

Type
Promise.<object>

getFiles(begin, end) → {Array.<File>}

Get files list on current page.

Parameters:
Name Type Description
begin number

a file index

end number

a file index

Source:
Returns:

the files in current page.

Type
Array.<File>

isPageCompleted() → {boolean}

Returns the listing files in current directory is completed.

Source:
Returns:

true if the listing files is completed.

Type
boolean

(async) readDir() → {Promise.<undefined>}

Read the files on current directory.

Source:
Returns:
Type
Promise.<undefined>

(async) reload() → {Promise}

Reload the file list.

Source:
Returns:

to sync

Type
Promise

uploadFile(file) → {Promise.<File>}

Upload a file.

Parameters:
Name Type Description
file File

the file to be uploaded.

Source:
Returns:

an uploaded File.

Type
Promise.<File>

writeFile(filename, mimeType, data) → {Promise.<object>}

Create or overwrite a file to current directory.

Parameters:
Name Type Description
filename string

The file name.

mimeType string

The content type.

data any

The file content.

Source:
Returns:

The response of update.

Type
Promise.<object>