I am trying to use ResourceBundle#getStringArray
to retrieve a String[]
from a properties file. The description of this method in the documentation
public String[] getPropertyStringArray(PropertyResourceBundle bundle, String keyPrefix) {
String[] result;
Enumeration keys = bundle.getKeys();
ArrayList temp = new ArrayList();
for (Enumeration e = keys; keys.hasMoreElements();) {
String key = e.nextElement();
if (key.startsWith(keyPrefix)) {
temp.add(key);
}
}
result = new String[temp.size()];
for (int i = 0; i < temp.size(); i++) {
result[i] = bundle.getString(temp.get(i));
}
return result;
}