renameFileSync method
Renames/moves a file from one path to another synchronously.
Throws an Exception if oldPath doesn't exist.
Implementation
@override
void renameFileSync(String oldPath, String newPath) {
final fullOldPath = _resolvePath(oldPath);
final fullNewPath = _resolvePath(newPath);
final file = File(fullOldPath);
if (!file.existsSync()) {
throw Exception('File does not exist: $oldPath');
}
File(fullNewPath).parent.createSync(recursive: true);
file.renameSync(fullNewPath);
}