By the way, for the buffer size, see the writeTo to method:
http://code.google.com/p/gdata-java-client/source/browse/trunk/java/src/com/google/gdata/data/media/MediaSource.java
It doesn't seem to be reading the whole file into memory.
I sense that this is doable even if not explicitely supported, it's
one of those things that comes down to how much you want it. I'm going
to play around with this later today, to see if i can find a way.
Bobby
On Dec 15, 3:03 pm, abe oppenheim <
abe.oppenh...@gmail.com> wrote:
> Thank you for your help. I was just confirming that in addition to
> monitoring progress, there is no current way to cancel an upload.
>
> On Tue, Dec 15, 2009 at 2:56 PM, Eric Bidelman <
api.e...@google.com> wrote:
> > Again, this is something we're looking into supporting. Hopefully for next
> > quarter.
>
> > Resumable upload will allow clients to:
> > -Initiate a resumable upload request
> > - pause an upload and resume it within 24hrs.
> > - query the status of an incomplete upload.
>
> > It'll look something like this:
> >
http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal
>
> > Eric
>
> > On Tue, Dec 15, 2009 at 11:40 AM, abe oppenheim <
abe.oppenh...@gmail.com>wrote:
>
> >> Well, my app makes the upload request to API. But once the API has read
> >> the entire inputstream into memory, which is does prior to upload, the API
> >> handles the upload internally, the processing of the memory buffer and
> >> socket whatnots. Unless some sort of cancel method is exposed by the API,
> >> i'm not sure how to cancel the request.
>
> >> The only things I can think of are really bad solutions. Like trying to
> >> kill the thread processing the request. Or extending/re-implementing some
> >> API class to allow an upload to be canceled.
>
> >> But I'm liking missing something. Which is why I'm asking...
>
> >> On Tue, Dec 15, 2009 at 2:29 PM, Eric Bidelman <
api.e...@google.com>wrote:
>
> >>> I guess I don't understand. Your app is making the request
> >>> to the API and it's in control of cancelling that request until the
> >>> doc has completed uploading (the server receives all
> >>> bytes according to the content-length header).
>
> >>> That said, I know curl provides tools like this (progress bar, resumable
> >>> upload):
> >>>
http://www.cs.sunysb.edu/documentation/curl/index.html
>
> >>> So, it is possible. In Java it might be another story :)
>
> >>> Eric
>
> >>> On Tue, Dec 15, 2009 at 10:41 AM, abe oppenheim <
abe.oppenh...@gmail.com
> >>> > wrote:
>
> >>>> There is no way to "cut off the request" through the api? My app could
> >>>> try to kill the thread processing the request, but that seems
> >>>> unpredictable.
>
> >>>> On Tue, Dec 15, 2009 at 1:33 PM, Eric Bidelman <
api.e...@google.com>wrote:
>
> >>>>> I suppose you (or your app) could cut off the request before
> >>>>> the upload is complete (eg. before an entry is returned
> >>>>> by the server).
>
> >>>>> On Tue, Dec 15, 2009 at 10:32 AM, abe oppenheim <
> >>>>>
abe.oppenh...@gmail.com> wrote:
>
> >>>>>> Thank you Eric. Would you also say there is no way to
> >>>>>> programmatically cancel an upload?
>
> >>>>>> On Tue, Dec 15, 2009 at 1:12 PM, Eric Bidelman <
api.e...@google.com>wrote:
>
> >>>>>>> Hi all,
>
> >>>>>>> The current upload path (we'll call it normal upload) sends
> >>>>>>> a file over the wire in its entirety. There's no way for you
> >>>>>>> to ping the server to request the upload's progress.
>
> >>>>>>> This is something a resumable upload feature would take care
> >>>>>>> of, which is something we're looking into for next quarter.
>
> >>>>>>> Eric
>
> >>>>>>> On Tue, Dec 15, 2009 at 8:16 AM, abe oppenheim <
> >>>>>>>
abe.oppenh...@gmail.com> wrote:
>
> >>>>>>>> Thank You, I was able to implement this to monitor the number of
> >>>>>>>> bytes read. However, it appears that the whole stream is in fact read into
> >>>>>>>> a very large memory buffer. I'm not sure how large, but large enough that
> >>>>>>>> when I monitored the progress of the inputStream for a 30mb file, the entire
> >>>>>>>> input stream was read in a few seconds. With this in mind, is there anyway
> >>>>>>>> I can monitor the upload of a file? Or, more importantly, cancel the upload
> >>>>>>>> upon user input?
>
> >>>>>>>> On Tue, Dec 15, 2009 at 5:01 AM, Bobby <
bobbysoa...@gmail.com>wrote:
>
> >>>>>>>>> I think you may be able to implement this by using the
> >>>>>>>>> MediaStreamSource class for uploading document contents:
>
> >>>>>>>>>
http://code.google.com/apis/gdata/javadoc/com/google/gdata/data/media...