Hi, 2009/11/11 François Cassistat <[email protected]>: > 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
