putPart method

JsonMap putPart(
  1. String principalId,
  2. String fileId,
  3. int number,
  4. String? contentDigest,
  5. Uint8List bytes,
)

uploadPart (12 3.2): stores part number of fileId after the length and digest checks; the same part with the same digest answers again without new work.

Throws 404 for a file of another principal, 410 gone for an aborted or expired session, 400 validation_failed (part_digest_mismatch) for a wrong length or digest, 409 conflict (part_conflict) for a used number with other bytes, and 503 unavailable for the fault "abort after part n".

Implementation

JsonMap putPart(
  String principalId,
  String fileId,
  int number,
  String? contentDigest,
  Uint8List bytes,
) {
  final f = _ownFile(principalId, fileId);
  return _storePart(f, number, contentDigest, bytes);
}