ArchiveFsOverrides.fromFile constructor

ArchiveFsOverrides.fromFile(
  1. File archive, {
  2. String mountTo = "",
})

Implementation

factory ArchiveFsOverrides.fromFile(File archive, {String mountTo = ""}) {
  if (archive.existsSync()) {
    throw ArgumentError.value(
      archive,
      "archive",
      "Must be a file which exists on the filesystem.",
    );
  }

  return ArchiveFsOverrides._(
    archive: archive_io.ZipDecoder().decodeBytes(archive.readAsBytesSync()),
    mountTo: mountTo,
  );
}