1 16 package org.outerj.daisy.repository; 17 18 import java.util.Locale ; 19 import java.util.ResourceBundle ; 20 import java.text.MessageFormat ; 21 22 public class AuthenticationFailedException extends RepositoryException implements LocalizedException { 23 private String login; 24 25 public AuthenticationFailedException(String login) { 26 this.login = login; 27 } 28 29 public String getMessage() { 30 return getMessage(Locale.US); 31 } 32 33 public String getMessage(Locale locale) { 34 ResourceBundle bundle = ResourceBundle.getBundle("org/outerj/daisy/repository/messages", locale); 35 return MessageFormat.format(bundle.getString("authentication-failed"), new Object [] {login}); 36 } 37 } 38 | Popular Tags |