copy method
Copies from one location to another the following data: file, directory, bytes, string.
Implementation
Future<AwsStorageResult<String>?> copy(
{String? from,
required String to,
required AwsStorageType type,
List<int>? bytes,
String? string}) async {
switch (type) {
case AwsStorageType.directory:
if (from != null) {
if (to.isNotEmpty) {
return AwsStorageResult((await _copyPathDirectory(from, to)).path);
}
}
break;
case AwsStorageType.file:
if (from != null) {
if (to.isNotEmpty) {
return AwsStorageResult<String>(
(await _copyPathFile(from, to)).path);
}
}
break;
case AwsStorageType.bytes:
if (bytes != null) {
return AwsStorageResult<String>(
(await _copyPathBytes(bytes, to)).path);
}
break;
case AwsStorageType.string:
if (string != null) {
return AwsStorageResult<String>((await _copyString(string, to)).path);
}
break;
}
return null;
}