Class that implements the DataAccess interface to manage data using a file-based storage system. It reads and writes data in JSON format from/to a file.

Implements

Constructors

Properties

dataFileExt: string = '.json'

The file extension for the data file.

Methods

  • Checks if a string is blank (empty or contains only whitespace).

    Parameters

    • str: string

      The string to check.

    Returns boolean

    True if the string is blank.

  • Loads the data from the data file. If the file does not exist or is empty, the default root element is saved and returned.

    Returns any

    The parsed data from the file.

  • Sets the path of the data file.

    Parameters

    • dataFile: string

      The new data file path.

    Returns void

  • Resolves the filename of the data file based on a given folder path.

    Parameters

    • folderPath: string

      The path of the folder.

    Returns string

    The full path of the data file.