Returns

Gets the information about the total storage space,
either internal or external depends on the given input

Parameters

storageType

Internal or external storage type

Returns

available space in bytes, -1 if no information is available

public
void
resetStats()

Thread-safe call to reset the disk stats.
If we know that the free space has changed recently (for example, if we have
deleted files), use this method to reset the internal state and
start tracking disk stats afresh, resetting the internal timer for updating stats.

Check if available space in the filesystem is greater than the given threshold.
Note that the free space stats are cached and updated in intervals of RESTAT_INTERVAL_MS.
If the amount of free space has crossed over the threshold since the last update, it will
return incorrect results till the space stats are updated again.

Parameters

storageType

StorageType (internal or external) to test

freeSpaceThreshold

compare the available free space to this size

Returns

whether free space is lower than the input freeSpaceThreshold,
returns true if disk information is not available