FilesystemReadPermission.directory constructor

FilesystemReadPermission.directory(
  1. String dir
)

Create a new filesystem permission that matches any file in a directory or one of its subdirectories.

Implementation

factory FilesystemReadPermission.directory(String dir) {
  final escaped = dir.replaceAll(r'\', r'\\').replaceAll(r'/', r'\/');
  return FilesystemReadPermission(RegExp('^$escaped.*'));
}