public static String getFormat(final String originalFilename) {
    final List<String> fileNameSplit = Splitter.on(".").splitToList(originalFilename);
    if (fileNameSplit.size() <= 1) {
      throw new BadRequestException("The file format is invalid.");
    }
    return fileNameSplit.get(fileNameSplit.size() - 1);
  }
@Test
  public void getFormat() {
    final String properties = ConfigFileUtils.getFormat("application+default+application.properties");
    assertEquals("properties", properties);

    final String yml = ConfigFileUtils.getFormat("application+default+application.yml");
    assertEquals("yml", yml);
  }