public Map<String, String> getLabels(FacesContext context,
UIComponent component) {
Map<String, String> labelsMap = new HashMap<String, String>();
ResourceBundle bundle1 = null;
ResourceBundle bundle2 = null;
UIFileUpload fileUpload = (UIFileUpload) component;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
String messageBundle = context.getApplication().getMessageBundle();
Object locale = fileUpload.getLocale();
if (locale == null) {
locale = context.getExternalContext().getRequestLocale();
}
if (null != messageBundle) {
bundle1 = ResourceBundle.getBundle(messageBundle, fileUpload
.getAsLocale(locale), loader);
}
try {
bundle2 = ResourceBundle.getBundle(FILE_UPLOAD_BUNDLE, fileUpload
.getAsLocale(locale), loader);
} catch (MissingResourceException e) {
// No external bundle was found, ignore this exception.
}