Google Drive REST API Download fortsetzen (Partial Download)

  • Antworten:3
Thomas Müller
  • Forum-Beiträge: 19

05.02.2016, 17:44:25 via Website

Hallo,

ich möchte es in meiner App möglich machen, einen Download von Google Drive mit der REST API fortzusetzen, indem ab dem der Download erst ab den vorhandenen Bytes anfängt.
Dazu steht unter https://developers.google.com/drive/v3/web/manage-downloads#partial_download etwas. Jedoch finde ich keine Methode, mit der man das in Java machen kann.

Weiß jemand wie das geht?

Antworten
Pascal P.
  • Admin
  • Forum-Beiträge: 11.286

05.02.2016, 20:06:26 via Website

Doch ist doch angegeben, du kannst im Header irgendwie die ByteRange mitgeben.

So ungefähr könnte das aussehen:

http://stackoverflow.com/a/3411558

LG Pascal //It's not a bug, it's a feature. :) ;)

Antworten
Thomas Müller
  • Forum-Beiträge: 19

05.02.2016, 20:56:10 via Website

Das Problem ist, dass ich keine HttpURLConnection , sondern eine HttpResponse oder HttpRequest aus der Drive Bibliothek habe. Der HttpRequest hab ich es jetzt geschafft den Header mitzugeben, aber dann kommt der Fehler 403 Forbidden.

02-05 20:51:24.087 11677-12492/com.tomathomas.tvrecords W/System.err: com.google.api.client.http.HttpResponseException: 403 Forbidden
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: {
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: "error": {
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: "errors": [
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: {
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: "domain": "usageLimits",
02-05 20:51:24.088 11677-12492/com.tomathomas.tvrecords W/System.err: "reason": "quotaExceeded",
02-05 20:51:24.094 11677-12492/com.tomathomas.tvrecords W/System.err: "message": "The download quota for this file has been exceeded",
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: "locationType": "other",
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: "location": "quota.download"
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: }
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: ],
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: "code": 403,
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: "message": "The download quota for this file has been exceeded"
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: }
02-05 20:51:24.095 11677-12492/com.tomathomas.tvrecords W/System.err: }

Antworten
Pascal P.
  • Admin
  • Forum-Beiträge: 11.286

05.02.2016, 23:09:41 via App

Da weiss ich auch nicht weiter...
Hab mit der DriveAPI noch nicht gearbeitet.

LG Pascal //It's not a bug, it's a feature. :) ;)

Antworten