0

When I use library to download the file, I always have to wait until the download has finished. If the download runs in a separate thread, I also have to wait until the download has finished, although an interrupt has been executed. Is there any clean solution? Maybe I have overlooked the function in the library to handle such a problem

OutputStream out = new FileOutputStream("/tmp/driveFile.jpg");

DriveFiles.Get request = drive.files().get(fileId);
request.getMediaHttpDownloader().setProgressListener(new CustomProgressListener());
request.executeMediaAndDownloadTo(out);
mk0stka
  • 1
  • 1
  • use partial downloads – pinoyyid Jan 29 '17 at 20:28
  • Here's the link to [partial download](https://developers.google.com/drive/v3/web/manage-downloads#partial_download) guide in Drive API. I think [this SO thread](http://stackoverflow.com/questions/15349296/implement-pause-resume-in-file-downloading) might also help you as the topic talks about Resuming and Pausing downloads. – ReyAnthonyRenacia Jan 30 '17 at 11:09

0 Answers0