prepareInput static method
Prepares a MergeInput for processing.
If the input is a path, it returns the path as is. If the input is bytes or url, it creates a temporary file from the bytes and returns the path to the temporary file.
Parameters:
input: The MergeInput to prepare
Returns: The path to the prepared input file
Implementation
static Future<String> prepareInput(MergeInput input) async {
switch (input) {
case PathMergeInput(:final path):
return path;
case BytesMergeInput(:final bytes):
return await _writeBytesToTempFile(bytes);
case UrlMergeInput(:final url):
final bytes = await getUrlBytes(url);
return await _writeBytesToTempFile(bytes);
}
}