private void validateCsvFile ( List < String [ ] > content , String fileName ) { if ( content . isEmpty ( ) ) { throw new MolgenisDataException ( format ( "CSV-file: [{0}] is empty" , fileName ) ) ; } if ( content . size ( ) == 1 ) { throw new MolgenisDataException ( format ( "Header was found, but no data is present in file [{0}]" , fileName ) ) ; } int headerLength = content . get ( 0 ) . length ; content . forEach ( row -> { if ( row . length != headerLength ) { throw new MolgenisDataException ( format ( "Column count in CSV-file: [{0}] is not consistent" , fileName ) ) ; } } ) ; }
Validates CSV file content .