jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: File download/upload progression
Date Wed, 11 Nov 2009 21:31:22 GMT
Hi,

2009/11/11 Fran├žois Cassistat <f@maya-systems.com>:
> My client would like a progress bar for monitoring the files being downloaded or
> uploaded on the server (with RMI).

Note that the RMI layer does not currently work with JCR 2.0.

> For downloading, I think this is not a problem since javax.jcr.Binary from JCR2.0
> provides getSize() and an InputStream.
>
> For uploading, I could make my own implementation of javax.jcr.Binary that
> mesmerize how many bytes were asked. It have chances to work. What do
> you think?

I don't think you need any JCR-specific functionality beyond the
Binary.getSize() method (or Property.getLength() for JCR 1.0) for such
a progress meter, as you can wrap the InputStream you receive from or
pass to the repository into something like
javax.swing.ProgressMonitorInputStream. Or if you just need to know
how many bytes have already been read, you can use the
CountingInputStream class from commons-io.

BR,

Jukka Zitting

Mime
View raw message