Thanks for pointing me to the right direction! I got it to work now. 2012/1/9 sebb-2-2 [via Apache Commons] < [email protected]>
> On 9 January 2012 18:27, Gary Gregory <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=0>> > wrote: > > I've wanted to do this in the past as well, but I do not see how to do > > it without a new API that takes in a listener. > > FileUtils.copyURLToFile uses IOUtils.copy(InputStream input, > OutputStream output) to do the actual copy, so perhaps you could wrap > one of the streams in a Counting Stream or Proxy Stream. > > > Gary > > > > On Mon, Jan 9, 2012 at 12:47 PM, Smig <[hidden > > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=1>> > wrote: > >> I'm using this method to download a set of files: > >> FileUtils.copyURLToFile(url,file); > >> > >> I found this to be much faster than the usual writing of bytes to a > stream. > >> > >> However, I ran into a problem. By using this method, I lost the ability > to > >> track the progress and give feedback to the user. > >> > >> If I'm downloading a large file, there's no way of knowing if it's > close to > >> finishing or even if it's downloading at all. > >> > >> Is there any way to get this information to update a JProgressBar? > >> > >> -- > >> View this message in context: > http://apache-commons.680414.n4.nabble.com/Track-progress-of-a-file-copy-tp4279297p4279297.html > >> Sent from the Commons - User mailing list archive at Nabble.com. > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [hidden > >> email]<http://user/SendEmail.jtp?type=node&node=4279799&i=2> > >> For additional commands, e-mail: [hidden > >> email]<http://user/SendEmail.jtp?type=node&node=4279799&i=3> > >> > > > > > > > > -- > > E-Mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=4>| [hidden > email] <http://user/SendEmail.jtp?type=node&node=4279799&i=5> > > JUnit in Action, 2nd Ed: http://bit.ly/ECvg0 > > Spring Batch in Action: http://bit.ly/bqpbCK > > Blog: http://garygregory.wordpress.com > > Home: http://garygregory.com/ > > Tweet! http://twitter.com/GaryGregory > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=6> > > For additional commands, e-mail: [hidden > > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=7> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=8> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=4279799&i=9> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://apache-commons.680414.n4.nabble.com/Track-progress-of-a-file-copy-tp4279297p4279799.html > To unsubscribe from Track progress of a file copy?, click > here<http://apache-commons.680414.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4279297&code=c21pZ21oQGdtYWlsLmNvbXw0Mjc5Mjk3fDY1MDk4OTA0OA==> > . > NAML<http://apache-commons.680414.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://apache-commons.680414.n4.nabble.com/Track-progress-of-a-file-copy-tp4279297p4282251.html Sent from the Commons - User mailing list archive at Nabble.com.
