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