loadFromPath method

Future<void> loadFromPath(
  1. String path
)

Loads the denylist from a local file path.

Implementation

Future<void> loadFromPath(String path) async {
  _logger.info('Loading denylist from path: $path');
  try {
    final file = File(path);
    if (!await file.exists()) {
      throw FileSystemException('Denylist file not found', path);
    }
    final bytes = await file.readAsBytes();
    _loadCompactBytes(bytes);
  } on FormatException {
    rethrow;
  } catch (e, st) {
    _logger.warning('Failed to load denylist from path: $path', e, st);
    rethrow;
  }
}