String destinationDefinitionDirPath = settings.getStringProperty(FFMQCoreSettings.DESTINATION_DEFINITIONS_DIR, null);
if (destinationDefinitionDirPath != null)
{
destinationDefinitionsDir = new File(destinationDefinitionDirPath);
if (!destinationDefinitionsDir.isDirectory())
throw new FFMQException("Destination definitions directory does not exist : "+destinationDefinitionsDir.getAbsolutePath(),"FS_ERROR");
}
else
log.warn("Destination definitions directory is not set, running in memory only mode.");
// Bridge definitions directory
String bridgeDefinitionDirPath = settings.getStringProperty(FFMQCoreSettings.BRIDGE_DEFINITIONS_DIR, null);
if (bridgeDefinitionDirPath != null)
{
bridgeDefinitionsDir = new File(bridgeDefinitionDirPath);
if (!bridgeDefinitionsDir.isDirectory())
throw new FFMQException("Bridge definitions directory does not exist : "+bridgeDefinitionsDir.getAbsolutePath(),"FS_ERROR");
}
// Templates directory
String templatesDirPath = settings.getStringProperty(FFMQCoreSettings.TEMPLATES_DIR, null);
if (templatesDirPath == null)
throw new FFMQException("Templates directory not defined : "+FFMQCoreSettings.TEMPLATES_DIR,"MISSING_SETTING");
templatesDir = new File(templatesDirPath);
if (!templatesDir.isDirectory())
throw new FFMQException("Templates directory does not exist : "+templatesDir.getAbsolutePath(),"FS_ERROR");
// Templates mapping file
String templatesMappingPath = settings.getStringProperty(FFMQCoreSettings.TEMPLATE_MAPPING_FILE, null);
if (!StringTools.isEmpty(templatesMappingPath))
{
templateMappingFile = new File(templatesMappingPath);
if (!templateMappingFile.canRead())
throw new FFMQException("Template mapping file does not exist : "+templateMappingFile.getAbsolutePath(),"FS_ERROR");
}
// Default data directory
String defaultDataDirPath = settings.getStringProperty(FFMQCoreSettings.DEFAULT_DATA_DIR, null);
if (defaultDataDirPath == null)
throw new FFMQException("Default data directory not defined : "+FFMQCoreSettings.DEFAULT_DATA_DIR,"MISSING_SETTING");
defaultDataDir = new File(defaultDataDirPath);
if (!defaultDataDir.isDirectory())
throw new FFMQException("Default data directory does not exist : "+defaultDataDir.getAbsolutePath(),"FS_ERROR");
// Auto-create
autoCreateQueues = settings.getBooleanProperty(FFMQCoreSettings.AUTO_CREATE_QUEUES, false);
autoCreateTopics = settings.getBooleanProperty(FFMQCoreSettings.AUTO_CREATE_TOPICS, false);