I am trying to use ResourceBundle#getStringArray
to retrieve a String[]
from a properties file. The description of this method in the documentation
example:
mail.ccEmailAddresses=he@anyserver.at, she@anotherserver.at
..
myBundle=PropertyResourceBundle.getBundle("mailTemplates/bundle-name", _locale);
..
public List getCcEmailAddresses()
{
List ccEmailAddresses=new ArrayList();
if(this.myBundle.containsKey("mail.ccEmailAddresses"))
{
ccEmailAddresses.addAll(Arrays.asList(this.template.getString("mail.ccEmailAddresses").split("\\s*(,|\\s)\\s*")));// 1)Zero or more whitespaces (\\s*) 2) comma, or whitespace (,|\\s) 3) Zero or more whitespaces (\\s*)
}
return ccEmailAddresses;
}