googleapis / googleapis/google-api-java-client

Handling Thread.interrupted in MediaHttpDownload

Open
#1,051 1 comment 0 reactions 0 assignees View on GitHub
priority: p4 type: feature request
Dominant language
Java
Stars
1.5k
Forks
772
Avg merge
1h 44m
Merged PRs (30d)
1

Description

I was wondering if you could make a change such as the following to handle stopping a download. The developer could interrupt the background Thread doing the download to stop it.

if (mediaContentLength <= nextByteIndex || Thread.interrupted()) {
// All required bytes have been downloaded from the server.
bytesDownloaded = mediaContentLength;
updateStateAndNotifyListener(DownloadState.MEDIA_COMPLETE);
return;
}

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.