ReportStarter: much more optimal searching for resource file
This commit is contained in:
parent
c45d46bf55
commit
80ae1dca25
|
@ -462,21 +462,14 @@ public class ReportStarter implements ProcessCall, ClientProcess {
|
||||||
resFile = getResourcesForResourceFile(jasperName, currLang);
|
resFile = getResourcesForResourceFile(jasperName, currLang);
|
||||||
// TODO: Implement file:/ for resources
|
// TODO: Implement file:/ for resources
|
||||||
} else {
|
} else {
|
||||||
File[] resources = reportDir.listFiles( new FileFilter( jasperName, reportDir, ".properties"));
|
resFile = new File(jasperName+"_"+currLang.getLocale().getLanguage()+".properties");
|
||||||
// try baseName + "_" + language
|
if (!resFile.exists()) {
|
||||||
for( int i=0; i<resources.length; i++) {
|
resFile = null;
|
||||||
if ( resources[i].getName().equals( jasperName+currLang.getLocale().getLanguage()+".properties")) {
|
|
||||||
resFile=resources[i];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (resFile==null) {
|
|
||||||
// try baseName only
|
|
||||||
for( int i=0; i<resources.length; i++) {
|
|
||||||
if ( resources[i].getName().equals( jasperName+".properties")) {
|
|
||||||
resFile=resources[i];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
if (resFile == null) {
|
||||||
|
resFile = new File(jasperName+".properties");
|
||||||
|
if (!resFile.exists()) {
|
||||||
|
resFile = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue