jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From François Cassistat...@maya-systems.com>
Subject Re: File download/upload progression
Date Wed, 11 Nov 2009 23:08:30 GMT

Le 2009-11-11 à 4:31 PM, Jukka Zitting a écrit :

> 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.
> 

Oh ?
I did not see that because as was developing with a local instance of JackRabbit.

Maybe I should write my own RMI interface in my application until it is ready.
Or, could I use something else to work with a JackRabbit 2.0 server? The only alternative
I know was spi2dav, but I think it uses JCR 1.0 API, no ?

>> 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.

Good idea! Thanks.

> 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