File

File

Class representing gpgfs File

Methods

(async) create(valueopt)

Source:

Create file if it does not exist

Parameters:
Name Type Attributes Default Description
value string <optional>
''

Content to save in file

(async) exists() → {boolean}

Source:

Check if all metadata and content exists on disk

Returns:
Type
boolean

(async) getLastchange() → {gpgfs_model.object_lastchange}

Source:

Last change metadata

Returns:
Type
gpgfs_model.object_lastchange

(async) getMetadata() → {gpgfs_model.object_meta}

Source:

File metadata

Returns:
Type
gpgfs_model.object_meta

(async) open()

Source:

Open and read metadata

(async) read() → {string}

Source:

Read content from file

Returns:
Type
string

(async) save(newContentopt)

Source:

Write content to file. Update metadata and re-index file in bucket index.

Parameters:
Name Type Attributes Default Description
newContent string <optional>
this.content