private void createApplication ( ) { String schema = getSchema ( ) ; ContentType contentType = null ; if ( m_config . schema . toLowerCase ( ) . endsWith ( ".json" ) ) { contentType = ContentType . APPLICATION_JSON ; } else if ( m_config . schema . toLowerCase ( ) . endsWith ( ".xml" ) ) { contentType = ContentType . TEXT_XML ; } else { logErrorThrow ( "Unknown file type for schema: {}" , m_config . schema ) ; } try { m_logger . info ( "Creating application '{}' with schema: {}" , m_config . app , m_config . schema ) ; m_client . createApplication ( schema , contentType ) ; } catch ( Exception e ) { logErrorThrow ( "Error creating schema: {}" , e ) ; } try { m_session = m_client . openApplication ( m_config . app ) ; } catch ( RuntimeException e ) { logErrorThrow ( "Application '{}' not found after creation: {}." , m_config . app , e . toString ( ) ) ; } String ss = m_session . getAppDef ( ) . getStorageService ( ) ; if ( ! Utils . isEmpty ( ss ) && ss . startsWith ( "OLAP" ) ) { m_bOLAPApp = true ; } loadTables ( ) ; }
Create the application from the configured schema file name .