How to disable programmatically Eclipse "Password Required" dialog?
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
- Go to Window Menu -> Preferences
- select General->Network Connections
- This page will have Active Provider as Manual/Native in drop down .
- 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()
{
});
精彩评论