FilesystemWritePermission.file constructor

FilesystemWritePermission.file(
  1. String file
)

Create a new filesystem permission that matches a specific file.

Implementation

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