googleapis / googleapis/google-api-java-client

Handling Thread.interrupted in MediaHttpDownload

Offen
#1,051 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
priority: p4 type: feature request
Vorherrschende Sprache
Java
Sterne
1.5k
Forks
772
Ø Merge
1 Std. 44 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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;
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.