adopt static method
Takes ownership of a file that is already in bucket's format — plain bytes, or a vault
file for the vault bucket — and files it under key. The download manager finishes
downloads this way so they are never copied twice.
Implementation
static Future<void> adopt(
String sourcePath,
String key, {
required int size,
UStorageBucket bucket = UStorageBucket.support,
Duration? expireIn,
String? mimeType,
String? sha256,
Map<String, String>? tags,
}) async {
await _ensure();
await _backend.move(sourcePath, _pathFor(bucket, key));
await _record(key, bucket, size, expireIn: expireIn, mimeType: mimeType, sha256: sha256, tags: tags);
}