New Network Settings API in NetBeans 7.0 RCP

Network Settings API has been recently added into NetBeans 7.0 RCP to allow RCP users to access a network proxy setting. The native launchers of NetBeans Platform detects network settings, mainly a network proxy settings, from operating system. This setting if found any, is the initial for NetBeans plugins when accessing the network. End-users of application (or IDE) can customize these settings in Tools|Options dialog.

A note: Since Beta2 NetBeans 7.0 can interpret also PAC like setting, i.e. automatic proxy configuration URL which provides proxies dynamically according to asked URL.

Network settings are absolutely transparent to plugins built on RCP, these plugins don't need to care of it, RCP installs own java.net.ProxySelector which returns network proxies according of settings in NetBeans and plugins don't need to specify a proxy. However, in some cases a plugin need to know the network setting (e.g. if they are using a external tool and need to setup it for accessing network). For these cases there is Network Settings API as part of Utilities API.

Using this API is quite easy, just call NetworkSettings.getProxyHost(java.net.URI u) for given URI to get a host name of network proxy, use similar method for getting a proxy port. In case if a proxy requires user authentication, there are the methods for get username and password.

Comments:

Čau Jirko,

regarding the note about PAC files. Does it mean that NetBeans RFE 142831 is implemented?

I can't see how to set the PAC file in trunk. Thanks.

Posted by Martin Krauskopf on February 14, 2011 at 02:02 AM CET #

Ahoj Martine, you are right. RFE 142831 is solved (details in the issuezilla). It's done in recent daily builds of NB7.0, including NB7.0Beta2. See you,
-jirka

Posted by Jiri Rechtacek on February 14, 2011 at 09:33 AM CET #

Good news. We had to use own complicated workaround for Instant JChem described in the issue (will get rid of it once we switch to NB 7.0 final). Will check the code how you did it.

See you in the pub one day! :)

Posted by Martin Krauskopf on February 14, 2011 at 09:51 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Rechtacek's

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today