Interface: IFileStorage

gpf.interfaces. IFileStorage

File Storage interface, defines base methods to access any kind of file storage

Since:
  • 0.1.9

Methods


close(stream)

Close the underlying file: the stream becomes unusable

Parameters:
Name Type Description
stream gpf.interfaces.IReadableStream | gpf.interfaces.IWritableStream

Stream to close

Since:
  • 0.1.9
Returns:

Resolved when closed

Type
Promise

createDirectory(path)

Create a directory

Parameters:
Name Type Description
path String

Storage path of the directory to create

Since:
  • 0.1.9
Returns:

Resolved when created

Type
Promise

deleteDirectory(path)

Delete a directory

Parameters:
Name Type Description
path String

Storage path to the directory

Since:
  • 0.1.9
Returns:

Resolved when deleted

Type
Promise

deleteFile(path)

Delete a file

Parameters:
Name Type Description
path String

Storage path to the file

Since:
  • 0.1.9
Returns:

Resolved when deleted

Type
Promise

explore(path)

Provide information on the content of a directory through an IEnumerator

Parameters:
Name Type Description
path String

Storage path to a directory to explore

Since:
  • 0.1.9
Returns:

Enumerator interface to get directory content names

Type
Promise.<gpf.interfaces.IEnumerator.<gpf.typedef.fileStorageInfo>>

getInfo(path)

Get information on the storage path

Parameters:
Name Type Description
path String

Storage path to get info from

Since:
  • 0.1.9
Returns:

information

Type
Promise.<gpf.typedef.fileStorageInfo>

openTextStream(path, mode)

Open storage path content as a text stream

Parameters:
Name Type Description
path String

Storage path to open stream on

mode gpf.fs.openFor

Switch between reading and appending

Since:
  • 0.1.9
Returns:

Stream to the file

Type
Promise.<(gpf.interfaces.IReadableStream|gpf.interfaces.IWritableStream)>