copy method
Copies the resource from sourcePath
to destinationPath
.
overwrite
determines if the request will fail if the destinationPath
already exists.
See:
- http://www.webdav.org/specs/rfc2518.html#METHOD_COPY for more information.
- copy_Request for the request sent by this method.
Implementation
Future<http.StreamedResponse> copy(
PathUri sourcePath,
PathUri destinationPath, {
bool overwrite = false,
}) async {
final request = copy_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;
}