开发者

How to disable programmatically Eclipse "Password Required" dialog?

开发者 https://www.devze.com 2023-02-05 15:34 出处:网络
I get \"Password Required\" eclipse dialog when i try to connect to some remote server with wrong user name and password.

I get "Password Required" eclipse dialog when i try to connect to some remote server with wrong user name and password.

The strange thing is that the Eclipse platform f开发者_开发知识库irst gets my response and show the dialog and only then it reaches my try/catch block.

I just want to disable this dialog manually or programmatically.


Window --> Preferences -- > General --> Network Connections --> Set Active Provider to Direct


  1. Go to Window Menu -> Preferences
  2. select General->Network Connections
  3. This page will have Active Provider as Manual/Native in drop down .
  4. Change it to "Direct"


Use this code before you send a request:

// use default authenticator in order to catch
// all connectivity exceptions and provide appropriate
// error message
// prevents eclipse from displaying "Password Required" dialog
Authenticator.setDefault(new Authenticator() 
{
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号