ConfigFileUtils { 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); }  static void check(MultipartFile file); static String getFormat(final String originalFilename); static String getAppId(final String originalFilename); static String getClusterName(final String originalFilename); static String getNamespace(final String originalFilename); static String toFilename(
      final String appId,
      final String clusterName,
      final String namespace,
      final ConfigFileFormat configFileFormat
  ); static String toFilePath(
      final String ownerName,
      final String appId,
      final Env env,
      final String configFilename
  );  }
@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); }