Apache NetBeans Wiki Index

Note: These pages are being reviewed.

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("link:http://example.com/updateCenter[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

Taken from platform-dev-mailing list 14.04.2016

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.

This page was exported from http://wiki.netbeans.org/DevFaqHowToChangeUpdateCenterURL , that was last modified by NetBeans user Markiewb on 2016-09-18T14:21:48Z.

NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.