objectExists method
Checks whether an object exists using HEAD.
Returns true when S3 responds with 200 OK.
Example:
final exists = await client.objectExists('uploads/avatar.png');
print(exists);
Implementation
Future<bool> objectExists(String key) async {
try {
final response = await _makeRequest(method: 'HEAD', path: key);
return response.statusCode == 200;
} catch (e) {
return false;
}
}