luongbs94 / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Ability to cancel a media upload in progress #671

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?

http://stackoverflow.com/questions/13634894/cancel-google-drive-upload-possible

http://javadoc.google-api-java-client.googlecode.com/hg/1.12.0-beta/com/google/a
pi/client/googleapis/media/MediaHttpUploader.html

http://developer.android.com/reference/android/os/AsyncTask.html

Java environments (e.g. Java 6, Android 2.3, App Engine, or All)?

All

Please describe the feature requested.

Details for the feature request can be found in the stackoverflow question 
above.  To summarize, if user clicks Cancel on the media upload, the 
implementation of doInBackground() in AsyncTask is supposed to check 
isCancelled() to stop the current media upload.  However, the implementation of 
MediaHttpUploader was designed to be used by a single thread, and so doesn't 
support this use case.  We should extend it to at least support cancellation by 
another thread.

Similarly for media download.

We may want to extend this feature to support cancellation of any HttpRequest.  
I'll open a separate feature request for that in the google-http-java-client.

Original issue reported on code.google.com by yan...@google.com on 3 Dec 2012 at 3:59

GoogleCodeExporter commented 9 years ago
I filed a feature request for cancelling HTTP requests:
http://code.google.com/p/google-http-java-client/issues/detail?id=172

Original comment by yan...@google.com on 3 Dec 2012 at 4:06

GoogleCodeExporter commented 9 years ago
Hi,

In the StackOverflow answer, it is advised to use interrupt function.

When I use it against the thread where is executed the upload, nothing happens 
too.

May be it should be included in the feature to come.

Regards

Original comment by mich...@benesty.fr on 24 Dec 2012 at 10:04

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 18 Jan 2013 at 3:15

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 20 Jan 2013 at 1:57

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 7 Feb 2013 at 12:05

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 10 Jun 2013 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by ngmic...@google.com on 3 Sep 2013 at 8:06

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 27 Sep 2013 at 12:04