ReplayFileSystem constructor

ReplayFileSystem({@required Directory recording })

Creates a new ReplayFileSystem.

Recording data will be loaded from the specified recording location. This location must have been created by RecordingFileSystem, or an ArgumentError will be thrown.

Implementation

factory ReplayFileSystem({
  @required Directory recording,
}) {
  String dirname = recording.path;
  String path = recording.fileSystem.path.join(dirname, kManifestName);
  File manifestFile = recording.fileSystem.file(path);
  if (!manifestFile.existsSync()) {
    throw ArgumentError('Not a valid recording directory: $dirname');
  }
  List<Map<String, dynamic>> manifest = const JsonDecoder()
      .convert(manifestFile.readAsStringSync())
      .cast<Map<String, dynamic>>();
  return ReplayFileSystemImpl(recording, manifest);
}