FilesystemWritePermission.directory constructor

FilesystemWritePermission.directory(
  1. String dir
)

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

Implementation

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