String basePath = contextPath.substring(0, dotx);
String suffix = contextPath.substring(dotx);
LocalizedNameGenerator generator = new LocalizedNameGenerator(basePath, locale, suffix);
while (generator.more())
{
String candidatePath = generator.next();
if (isExistingResource(candidatePath))
return new LocalizedResource(candidatePath, generator.getCurrentLocale());