CloudflareR2Filesystem constructor

CloudflareR2Filesystem({
  1. required CloudflareR2Bucket bucket,
  2. String? prefix,
  3. bool readOnly = false,
  4. bool throwOnError = false,
})

Creates a filesystem backed by bucket.

prefix is an optional object-key prefix without special R2 semantics; it is normalized to slash-separated relative segments. When readOnly is true, write operations return false, or throw when throwOnError is also true.

Implementation

CloudflareR2Filesystem({
  required this.bucket,
  String? prefix,
  this.readOnly = false,
  this.throwOnError = false,
}) : prefix = _normalizePrefix(prefix);