final String suffix, final boolean reverseOrder, final boolean single, final boolean returnKey, final String key,
final boolean returnStrings, final boolean ignoreMissing) {
final List matches = new ArrayList();
final String contentType = clientkey.getContentType();
final Theme theme = clientkey.getTheme();
final UserAgent browser = clientkey.getUserAgent();
final List<String> locales = LocaleUtils.getLocaleSuffixList(clientkey.getLocale());
// check first the local web application directory
for (final 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 {
final 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 (final Theme currentTheme : theme.getFallbackList()) {// theme loop
for (final String resourceDirectory : tobagoConfig.getResourceDirs()) {
for (final String browserType : browser.getFallbackList()) { // browser loop
for (final 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);