DevFaqHowToChangeUpdateCenterURL

How to change the update center URL via code?

Use UpdateUnitProviderFactory [1]!

               List<UpdateUnitProvider> updateUnitProviders = UpdateUnitProviderFactory.getDefault().getUpdateUnitProviders(true);
               for (int i = 0; i < updateUnitProviders.size(); i++) {
                   UpdateUnitProvider pr = updateUnitProviders.get(i);
                   String name = pr.getDisplayName();
                   if("MyUpdateCenter".equals(name)){
                           pr.setProviderURL(new URL("http://example.com/updateCenter"));
                           pr.refresh(ProgressHandle.createHandle("UpdateCenter refresh"), true);
                           break;
                   }
               }

or

https://github.com/testmycode/tmc-netbeans/blob/master/tmc-plugin/src/fi/helsinki/cs/tmc/actions/TmcModuleInstall.java#L105-L129

[1] http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-autoupdate-services/org/netbeans/api/autoupdate/UpdateUnitProviderFactory.html Taken from platform-dev-mailing list 14.04.2016

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