FilesAdapter

Adapters~ FilesAdapter

Methods

createFile(filename, data, contentType) → {Promise}

Responsible for storing the file in order to be retrieved later by its filename

Parameters:
Name Type Description
filename string

the filename to save

data *

the buffer of data from the file

contentType string

the supposed contentType

Returns:
Type:
Promise

a promise that should fail if the storage didn't succeed

deleteFile(filename) → {Promise}

Responsible for deleting the specified file

Parameters:
Name Type Description
filename string

the filename to delete

Returns:
Type:
Promise

a promise that should fail if the deletion didn't succeed

getFileData(filename) → {Promise}

Responsible for retrieving the data of the specified file

Parameters:
Name Type Description
filename string

the name of file to retrieve

Returns:
Type:
Promise

a promise that should pass with the file data or fail on error

getFileLocation(config, filename) → {string}

Returns an absolute URL where the file can be accessed

Parameters:
Name Type Description
config Config

server configuration

filename string
Returns:
Type:
string

Absolute URL