Autoupdate EVERY_STARTUP

The core snippet is here:

public class Installer extends ModuleInstall {
     public void restored() {
         modifyAutoupdateSettings();
     }

     private void modifyAutoupdateSettings () {
         Settings autoupdateSettings =
(Settings)SharedClassObject.findObject(Settings.class);
         autoupdateSettings.setPeriod(Settings.EVERY_STARTUP);
     }
}

You need to add Autoupdate and Settings Options API modules among your
project libraries. Then use Module Installer template from NetBeans
Module Development category in File|New file wizard and put this code
snippet into Installer class.
This code will force Autoupdate module to connect all enabled Update
Centers on every startup regardless of user's settings.
If you would like to respect user's setting, you have to ensure the code
is called only once.

你可能感兴趣的:(Netbeans)