Automatically download from Sourceforge during installation

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

Is there a way to do automatic loading from SF?

How can I make sure the download uses the best mirror?

+4
source share
2 answers

If you add ?use_mirror=autoselect to the download path (starting at http://downloads.sourceforge.net/project/ ), SourceForge will send a β€œ302 found” response to redirect you to the nearest mirror. For instance:

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

Redirecting to the following location for me:

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

Regarding downloading the latest version, you can parse the RSS feed for the project files.

+4
source

You can capture the download page (e.g. http://sourceforge.net/projects/cpptest/files/cpptest/cpptest-1.1.0/cpptest-1.1.0.zip/download ) and scan Please use this <a href="http://downloads.sourceforge.net/project/.../...?use_mirror=..." class="direct-download">direct link</a> using a regular expression. Then you have a blacksmith's forge to choose a mirror for you.

0
source

Source: https://habr.com/ru/post/1302242/


All Articles