private static DumpContentType guessDumpContentType ( String fileName ) { String lcDumpName = fileName . toLowerCase ( ) ; if ( lcDumpName . contains ( ".json.gz" ) ) { return DumpContentType . JSON ; } else if ( lcDumpName . contains ( ".json.bz2" ) ) { return DumpContentType . JSON ; } else if ( lcDumpName . contains ( ".sql.gz" ) ) { return DumpContentType . SITES ; } else if ( lcDumpName . contains ( ".xml.bz2" ) ) { if ( lcDumpName . contains ( "daily" ) ) { return DumpContentType . DAILY ; } else if ( lcDumpName . contains ( "current" ) ) { return DumpContentType . CURRENT ; } else { return DumpContentType . FULL ; } } else { logger . warn ( "Could not guess type of the dump file \"" + fileName + "\". Defaulting to json.gz." ) ; return DumpContentType . JSON ; } }
Guess the type of the given dump from its filename .