How to mirroring Update Centers

Server side

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 for Update Centers in NetBeans IDE 6.1.

IDE side

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:

  • specifies prefix of URL which will be replaced, like this
  • specifies path to mirror, like this
  • if true (as default value) then all Update Centers with a different URL than specified in will be deactivated. If false the Update Centers will be left same vice-versa.

Prototype of Update Center Mirror plugin

  • Download NBM
  • Launch NetBeans 6.1 IDE and invoke Tools|Plugins
  • Go into Download tab and install the NBM
  • Use launcher options specified above to control Update Center Mirror plugin. Like this
./netbeans/bin/netbeans --userdir ./mytestmirror

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

Do not hesitate to contact me on if you have any question.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo