putArchive method

Future<void> putArchive(
  1. String id,
  2. String path,
  3. Uint8List tarData
)

Uploads a tar archive to the container's filesystem.

Sends PUT /containers/{id}/archive?path={path} with tarData as the request body. The archive is extracted at path inside the container.

Parameters:

  • id — container ID.
  • path — destination directory inside the container (e.g. '/').
  • tarData — raw tar bytes (as produced by buildTransferTar).

Implementation

Future<void> putArchive(
  String id,
  String path,
  Uint8List tarData,
) async {
  final resp = await _request(
    'PUT',
    '/containers/$id/archive',
    queryParams: {'path': path},
    body: tarData,
  );
  if (resp.statusCode != 200 && resp.statusCode != 204) {
    _throwIfError(resp);
  }
}