if (directory == null || urlPrefix == null) {
return null;
}
AWApplication application = AWConcreteApplication.defaultApplication();
AWMultiLocaleResourceManager resourceManager = application.createResourceManager();
// Register the app specific brand directory (e.g. brands/simple/Buyer)
String appName = application.name();
String appDirectory = StringUtil.strcat(directory, File.separator, appName);
String appUrlPrefix = StringUtil.strcat(urlPrefix, "/", appName);
resourceManager.registerResourceDirectory(appDirectory, appUrlPrefix);
// Register the brand directory itself (e.g. brands/simple)
resourceManager.registerResourceDirectory(directory, urlPrefix);
// Chain to the default resource manager so non branded resources
// are found.
resourceManager.setNextResourceManager(application.resourceManager());
return resourceManager;
}