You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by François Cassistat <f...@maya-systems.com> on 2009/11/11 22:19:16 UTC
File download/upload progression
Hi list !
My client would like a progress bar for monitoring the files being downloaded or uploaded on the server (with RMI).
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? Does JackRabbit would care if I don't pass by ValueFactory.createBinary()?
Frank
Re: File download/upload progression
Posted by François Cassistat <f...@maya-systems.com>.
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
Re: File download/upload progression
Posted by Jukka Zitting <ju...@gmail.com>.
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