FileCassetteStore class final

A file-backed store for encoded cassette bytes.

The store is format-neutral: reads enforce maximumBytes but do not decode UTF-8, parse JSON or validate a cassette schema. Creation is exclusive and explicit replacement is atomic where the file system supports replacement rename. Conditional replacement compares the complete previously read content rather than file metadata.

Implemented types

Constructors

FileCassetteStore(Directory root, {int maximumBytes = defaultMaximumCassetteBytesV1})
Creates a file store rooted at root.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
maximumBytes → int
The maximum number of encoded bytes accepted for one cassette.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

create(CassetteName name, List<int> bytes) → Future<void>
Creates name from encoded bytes only when it is absent.
override
exists(CassetteName name) → Future<bool>
Reports whether name currently exists.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(CassetteName name) → Future<CassetteSnapshot>
Reads one immutable snapshot for name.
override
replace(CassetteName name, List<int> bytes) → Future<void>
Explicitly replaces existing name with encoded bytes.
override
replaceIfUnchanged(CassetteSnapshot snapshot, List<int> bytes) → Future<void>
Replaces snapshot with encoded bytes only if its revision is current.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaultMaximumBytesV1 → const int
The default maximum encoded V1 cassette size of 64 MiB.