private void loadFolder ( File folder ) { m_logger . info ( "Scanning for files in folder: {}" , folder . getAbsolutePath ( ) ) ; File [ ] files = folder . listFiles ( ) ; if ( files == null || files . length == 0 ) { m_logger . error ( "No files found in folder: {}" , folder . getAbsolutePath ( ) ) ; return ; } for ( File file : files ) { String fileName = file . getName ( ) . toLowerCase ( ) ; if ( ! fileName . endsWith ( ".csv" ) && ! fileName . endsWith ( ".zip" ) ) { continue ; } TableDefinition tableDef = determineTableFromFileName ( file . getName ( ) ) ; if ( tableDef == null ) { m_logger . error ( "Ignoring file; unknown corresponding table: {}" , file . getName ( ) ) ; continue ; } try { if ( fileName . endsWith ( ".csv" ) ) { loadCSVFile ( tableDef , file ) ; } else { loadZIPFile ( tableDef , file ) ; } } catch ( IOException ex ) { m_logger . error ( "I/O error scanning file '{}': {}" , file . getName ( ) , ex ) ; } } }
Load all files in the given folder whose name matches a known table .