javadownloadsourceforge

Automatic download from Sourceforge during installation


I have a Java project which uses platform specific libraries. They are quite large but I can figure out which ones I need in an installer and download them. I'd like to download them from Sourceforge (where the rest of my project lives).

Is there a way to do automatic downloads from SF?

How do I make sure the download use the best mirror?


Solution

  • If you append ?use_mirror=autoselect to the path of your download (beginning with http://downloads.sourceforge.net/project/), SourceForge will send a 302 Found response to redirect you to your closest mirror. For example:

    http://downloads.sourceforge.net/project/getgnuwin32/getgnuwin32/0.6.30/GetGnuWin32-0.6.3.exe?use_mirror=autoselect

    Redirects to the following location for me:

    http://superb-sea2.dl.sourceforge.net/project/getgnuwin32/getgnuwin32/0.6.30/GetGnuWin32-0.6.3.exe

    In terms of downloading the latest version, you can parse the RSS feed for the project's files.