Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resetting Java's Authenticator

I'm using the Autheticator class to access a password-protected URL. I've extended it and created my own authenticator, and I set it as the default authenticator using Authenticator#setDefault(java.net.Authenticator). Once I'm done accessing the URL, I'd like to reset the authenticator. The Javadoc says that setting it to null removes any previously set authenticator. But I'm not sure if that means that it has been reset to use the default authenticator (is there such a thing?).

like image 571
Vivin Paliath Avatar asked Aug 06 '26 19:08

Vivin Paliath


1 Answers

In the source code of Sun's JDK implemenentation null is the default value.

like image 149
palacsint Avatar answered Aug 09 '26 07:08

palacsint