private void importResolverVisMapTable ( String path , String table , String annisFileSuffix ) { try { // count cols for detecting old resolver_vis_map table format File resolver_vis_tab = new File ( path , table + annisFileSuffix ) ; if ( ! resolver_vis_tab . isFile ( ) ) { return ; } String firstLine ; try ( BufferedReader bReader = new BufferedReader ( new InputStreamReader ( new FileInputStream ( resolver_vis_tab ) , "UTF-8" ) ) ) { firstLine = bReader . readLine ( ) ; } int cols = 9 ; // default number if ( firstLine != null ) { String [ ] entries = firstLine . split ( "\t" ) ; cols = entries . length ; log . debug ( "the first row: {} amount of cols: {}" , entries , cols ) ; } switch ( cols ) { // old format case 8 : readOldResolverVisMapFormat ( resolver_vis_tab ) ; break ; // new format case 9 : bulkloadTableFromResource ( tableInStagingArea ( table ) , new FileSystemResource ( new File ( path , table + annisFileSuffix ) ) ) ; break ; default : log . error ( "invalid amount of cols" ) ; throw new RuntimeException ( ) ; } } catch ( IOException | FileAccessException e ) { log . error ( "could not read {}" , table , e ) ; } }
Imported the old and the new version of the resolver_vis_map . tab . The new version has an additional column for visibility status of the visualization .