@Override
protected AbstractRuntimeConfiguration onBeforeOpen() throws Exception {
//-- (LOG4J) logging configuration file --//
final String loggingFileName = super.getApplication().getAppPath() + "/configuration/logging.lcf";
final BeeResource resLogging = this.getResource(loggingFileName);
if (resLogging.exists()) {
PropertyConfigurator.configure(resLogging.getUrl());
}
//-- ADD-ONS Folders initialization --//
final BeeResource resAddOns = BeeLocalStore.getInstance().getResource(
super.getApplication().getAddOnsPath().concat("/readme.txt"), true);
if (!resAddOns.exists()) {
resAddOns.setText("Copy in this folder all add-on libraries.");
}
final BeeResource resAddOnsRes = BeeLocalStore.getInstance().getResource(
super.getApplication().getResourcesPath().concat("/readme.txt"), true);
if (!resAddOnsRes.exists()) {
resAddOnsRes.setText("Copy in this folder all add-on resources.");
}
// addons files
final BeeResource resAddOnsFolder = BeeLocalStore.getInstance().getResource(
super.getApplication().getAddOnsPath());
final String[] addons = resAddOnsFolder.getChildren(0);
if (!CollectionUtils.isEmpty(addons)) {
this.initAddOns(addons);
}
//-- main configuration file --//
final String beeingFileName = PathUtils.concat(
super.getApplication().getAppPath(), RuntimeConfigFile.FILE_NAME);
final BeeResource resConfig = this.getResource(beeingFileName);
if (!resConfig.exists()) {
return null;
}
final RuntimeConfigFile file = super.createConfigurationFile(resConfig.getUrl());
final AbstractRuntimeConfiguration config = new BeeAppRuntimeConfigController(
super.getApplication().getAppPath(), file);
return config;
}