if(e instanceof AuthException) {
// Prompts the user for a login and password.
AuthException authException = (AuthException)e;
FileURL url = authException.getURL();
AuthDialog authDialog = new AuthDialog(WindowManager.getCurrentMainFrame(), url, true, authException.getMessage());
authDialog.showDialog();
newCredentialsMapping = authDialog.getCredentialsMapping();
if(newCredentialsMapping !=null) {
// Use the provided credentials
CredentialsManager.authenticate(url, newCredentialsMapping);
path = url.toString(true);