removeIncompleteUpload method

Future<void> removeIncompleteUpload(
  1. String bucket,
  2. String object
)

Remove the partially uploaded object.

Implementation

Future<void> removeIncompleteUpload(String bucket, String object) async {
  MinioInvalidBucketNameError.check(bucket);
  MinioInvalidObjectNameError.check(object);

  final uploadId = await findUploadId(bucket, object);
  if (uploadId == null) return;

  final resp = await _client.request(
    method: 'DELETE',
    bucket: bucket,
    object: object,
    queries: {'uploadId': uploadId},
  );

  validate(resp, expect: 204);
}