Fixed: Theme files loading taking longer time
Thanks: Pierre and Jacques for the review.
@@ -78,9 +78,11 @@ public class ThemeFactory {
*/
private static void pullModelThemesFromXmlToCache() {
String ofbizHome = System.getProperty("ofbiz.home");
+ String themeFolderPath = ofbizHome + "/themes";
+ String pluginsFolderPath = ofbizHome + "/plugins";
try {
- List<File> xmlThemes = FileUtil.findXmlFiles(ofbizHome, "themes", "theme", "widget-theme.xsd");
- List<File> xmlPluginThemes = FileUtil.findXmlFiles(ofbizHome, "plugins", "theme", "widget-theme.xsd");
+ List<File> xmlThemes = FileUtil.findXmlFiles(themeFolderPath, null, "theme", "widget-theme.xsd");
+ List<File> xmlPluginThemes = FileUtil.findXmlFiles(pluginsFolderPath, null, "theme", "widget-theme.xsd");
if (UtilValidate.isNotEmpty(xmlPluginThemes)) {
xmlThemes.addAll(xmlPluginThemes);
}
