in sample/src/resumable/ResumableSample.cc [137:165]
void ResumableSample::ResumableFileDownloadStopOnce(const std::string& fileID)
{
ResetProgressControlCallTimes();
FileDownloadRequest downloadRequest(Config::DriveID, "", fileID, Config::FileDownloadTo, Config::CheckpointDir);
TransferProgress progressCallback = { ProgressCallback , this };
downloadRequest.setTransferProgress(progressCallback);
ProgressControl progressControlStopCallback = { ProgressControlStopCallback , this };
downloadRequest.setProgressControl(progressControlStopCallback);
auto getOutcome = client->ResumableFileDownload(downloadRequest);
if (!getOutcome.isSuccess()) {
PrintError(__FUNCTION__, getOutcome.error());
}
else {
std::cout << __FUNCTION__ << " first time call ResumableFileDownload success" << std::endl;
return;
}
ProgressControl progressControlCallback = { ProgressControlCallback , this };
downloadRequest.setProgressControl(progressControlCallback);
getOutcome = client->ResumableFileDownload(downloadRequest);
if (!getOutcome.isSuccess()) {
PrintError(__FUNCTION__, getOutcome.error());
}
else {
std::cout << __FUNCTION__ << " second time call ResumableFileDownload success" << std::endl;
}
}