Hi!

I would like to have a download link through which a user can download some
bytearray from my database. So far no problem, I accomplish this by creating
a new WebResource and implementing the getResourceStream method.

My problem is that I would like to be notified when the user is finished
downloading so that I can mark the downloaded item as downloaded in my
database. I'm using an AbstractResourceStream and I thought I would be able
to do this by overriding the close() method. However, the close method of
the AbstractResourceStream never seems to be called.

The implementation of the getResourceStream() method of my WebResource
object:

            public IResourceStream getResourceStream() {
                return new AbstractResourceStream() {
                    ByteArrayInputStream bais;
                    public InputStream getInputStream() throws
ResourceStreamNotFoundException {
                        bais = getByteArrayInputStreamFromDB();
                        return bais; 
                    }

                    public void close() throws IOException {
                        bais.close();
                        markByteArrayAsDownloadedInDB();
                    }
                };
            }


Why is it that the close() method is never called? Is there a better/other
way to do it? Is it at all possible to get a callback when a user is
finished downloading the bytearray?

Thanks in advance!

/Daniel
-- 
View this message in context: 
http://www.nabble.com/Browser-file-download-complete-callback-tp20300290p20300290.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to