Use the unix command wget --mirror or any similar on other systems and expose downloaded catalog.xml.gz and corresponding NBMs. Like this wget --mirror http://updates.netbeans.org/netbeans/updates/6.1/uc/final for Update Centers in NetBeans IDE 6.1.
Use Autoupdate Services API to manipulate URL of subscribed Update Centers. The API contains the class UpdateUnitProviderFactory which can return all subscribed Update Center, ask them for its URL and change them to new (mirroring) location.
for (UpdateUnitProvider p : UpdateUnitProviderFactory.getDefault ().getUpdateUnitProviders (false)) {
URL oldurl = p.getProviderURL ();
URL newurl = <...your mirror...>
p.setProviderURL (newurl);
}
There is a sample NetBeans project Update Center Mirror (zipped project w/ sources
) using this pattern to re-direct NetBeans Update Center from original location to mirrors. NetBeans module built from these sources can be installed in IDE. Users can use several options to take control over that module:
./netbeans/bin/netbeans --userdir ./mytestmirror -J-Dupdate.center.mirror.replace=http://updates.netbeans.org/netbeans/ -J-Dupdate.center.mirror.path=file:///space/temp/updates.netbeans.org/netbeans/
This is a prototype only: play with it on own risk. Need to customize to each particular usage.
Applies to: NetBeans 6.1 or newer
Platforms: All
| org-netbeans-modules-updatecentermirror.nbm | ![]() |
6694 bytes |
| updatecentermirror.zip | ![]() |
14448 bytes |