move method

Future<StreamedResponse> move(
  1. PathUri sourcePath,
  2. PathUri destinationPath, {
  3. bool overwrite = false,
})

Moves the resource from sourcePath to destinationPath.

overwrite determines if the request will fail if the destinationPath already exists.

See:

Implementation

Future<http.StreamedResponse> move(
  PathUri sourcePath,
  PathUri destinationPath, {
  bool overwrite = false,
}) async {
  final request = move_Request(
    sourcePath,
    destinationPath,
    overwrite: overwrite,
  );

  final streamedResponse = await httpClient.send(request);
  if (streamedResponse.statusCode != 201 && streamedResponse.statusCode != 204) {
    final response = await http.Response.fromStream(streamedResponse);
    throw DynamiteStatusCodeException(response);
  }

  return streamedResponse;
}