1 22 package org.netbeans.lib.cvsclient.connection; 23 24 import java.util.*; 25 26 import org.netbeans.lib.cvsclient.util.*; 27 28 36 public class AuthenticationException extends Exception { 37 40 private Throwable underlyingThrowable; 41 42 private String message; 43 44 private String localizedMessage; 45 46 51 public AuthenticationException(String message, String localizedMessage) { 52 super(message); 53 this.message = message; 54 this.localizedMessage = localizedMessage; 55 } 56 57 63 public AuthenticationException(String message, 64 Throwable underlyingThrowable, 65 String localizedMessage) { 66 this(message, localizedMessage); 67 initCause(underlyingThrowable); 68 } 69 70 75 public AuthenticationException(Throwable underlyingThrowable, 76 String localizedMessage) { 77 this.localizedMessage = localizedMessage; 78 initCause(underlyingThrowable); 79 } 80 81 85 public Throwable getUnderlyingThrowable() { 86 return getCause(); 87 } 88 89 public String getLocalizedMessage() { 90 if (localizedMessage == null) { 91 return message; 92 } 93 return localizedMessage; 94 } 95 96 public String getMessage() { 97 return message; 98 } 99 100 protected static String getBundleString(String key) { 101 String value = null; 102 try { 103 ResourceBundle bundle = BundleUtilities.getResourceBundle(AuthenticationException.class, "Bundle"); if (bundle != null) { 105 value = bundle.getString(key); 106 } 107 } 108 catch (MissingResourceException exc) { 109 } 110 return value; 111 } 112 } 113 | Popular Tags |