copy method

  1. @override
Future<void> copy(
  1. String from,
  2. String to
)
override

Copy from onto to, overwriting. No-op when from is absent.

Here rather than composed from read + write because an implementation may be able to do it without materialising the contents.

Implementation

@override
Future<void> copy(String from, String to) async {
  final contents = await read(from);
  if (contents == null) return;
  await write(to, contents);
}