0

I'm using the below to let the user download to the latest version of my program.

FileUtils.copyURLToFile(URL, new File(directory));

This works fine, however I can't figure out how best to let the user know that the file download is complete. The experience is simply that the program has frozen for a moment, and then the file appears where they asked it to.

The file to be downloaded is a zip, around ~2mb if that matters.

  • You can't from the API according to [this](http://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html) – Ali Gajani May 24 '15 at 00:16
  • 2
    You will want to run this as a separate thread. Depending on your use-case you might be able to run this in a Thread (almost all cases), SwingWorker (if using Swing), AsyncTask (android), etc. – nanofarad May 24 '15 at 00:17
  • FileUtils work with files. To download file from http use this [link][1]. [1]: http://stackoverflow.com/questions/921262/ – Alex May 24 '15 at 00:19
  • Threads have never been my strong point unfortunately, I couldn't get it working properly with SwingWorker, parts of the gui would not always load correctly. I've given up for now and simply provide a msgbox before and after, letting users know that it has commenced, and then either succeeded or failed. My internet connection is horrendous and it still only takes 10-15seconds or so to download for me so hopefully it should be fine for the users too. – Mario Cappellano May 24 '15 at 04:30

0 Answers0