@Test public void testGetDataTypeFromFileName() { String fileName = "abcd.file"; String fileType = StringHelper.getDataTypeFromFileName(fileName); assertThat(fileType).isEqualTo("file"); }
public static String getDataTypeFromFileName(String fileName) { if (fileName.contains(".")) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); } else { return UNKNOWN_DATATYPE; } }
StringHelper { public static String getDataTypeFromFileName(String fileName) { if (fileName.contains(".")) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); } else { return UNKNOWN_DATATYPE; } } }
StringHelper { public static String getDataTypeFromFileName(String fileName) { if (fileName.contains(".")) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); } else { return UNKNOWN_DATATYPE; } }  }
StringHelper { public static String getDataTypeFromFileName(String fileName) { if (fileName.contains(".")) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); } else { return UNKNOWN_DATATYPE; } }  static boolean isValidEmail(final String email); static String getDataTypeFromFileName(String fileName); static String addNumberToFileName(String fileName, int number); static boolean isEmpty(final String queryString); static String getTextForLanguage(String text, String lang); }
StringHelper { public static String getDataTypeFromFileName(String fileName) { if (fileName.contains(".")) { return fileName.substring(fileName.lastIndexOf(".") + 1, fileName.length()); } else { return UNKNOWN_DATATYPE; } }  static boolean isValidEmail(final String email); static String getDataTypeFromFileName(String fileName); static String addNumberToFileName(String fileName, int number); static boolean isEmpty(final String queryString); static String getTextForLanguage(String text, String lang); static final String UNKNOWN_DATATYPE; static final Pattern EMAIL_PATTERN; }