copy method
Copies fromAbs to toAbs. Auto-creates any missing parent
directories at the destination. Overwrites toAbs if present.
@param fromAbs Absolute source path. Must exist.
@param toAbs Absolute destination path.
@throws FileSystemException When fromAbs is missing.
Implementation
@override
void copy(String fromAbs, String toAbs) {
// 1. Reject early when the source is missing so the error is identical to
// InMemoryFs's `! ` failure mode and matches the documented contract.
if (!File(fromAbs).existsSync()) {
throw FileSystemException('Source file not found', fromAbs);
}
// 2. Ensure the destination's parent exists; dart:io's File.copySync
// refuses to create missing directories.
FileHelper.ensureDirectoryExists(File(toAbs).parent.path);
FileHelper.copyFile(fromAbs, toAbs);
}