boolean reverseOrder, boolean single, boolean returnKey, String key, boolean returnStrings,
boolean ignoreMissing) {
List matches = new ArrayList();
String contentType = clientkey.getContentType();
Theme theme = clientkey.getTheme();
UserAgent browser = clientkey.getUserAgent();
List<String> locales = LocaleUtils.getLocaleSuffixList(clientkey.getLocale());
// check first the local web application directory
for (String localeSuffix : locales) {
if (production) {
boolean found = checkPath(prefix, reverseOrder, returnKey, returnStrings, matches,
name, MINIMIZE_SUFFIX, localeSuffix, suffix, key);
if (found && (single || !returnStrings)) {
return matches;
}
if (!found) {
found = checkPath(prefix, reverseOrder, returnKey, returnStrings, matches,
name, null, localeSuffix, suffix, key);
if (found && (single || !returnStrings)) {
return matches;
}
}
} else {
boolean found = checkPath(prefix, reverseOrder, returnKey, returnStrings, matches,
name, null, localeSuffix, suffix, key);
if (found && (single || !returnStrings)) {
return matches;
}
}
}
// after that check the whole resources tree
// e.g. 1. application, 2. library or renderkit
for (Theme currentTheme : theme.getFallbackList()) {// theme loop
for (String resourceDirectory : tobagoConfig.getResourceDirs()) {
for (String browserType : browser.getFallbackList()) { // browser loop
for (String localeSuffix : locales) { // locale loop
if (production) {
boolean found = checkPath(prefix, reverseOrder, returnKey, returnStrings, matches,
resourceDirectory, contentType, currentTheme, browserType, subDir, name, MINIMIZE_SUFFIX,
localeSuffix, suffix, key);