code: private static String getFileExtension(Resource file) {
  	String name = file.getName();
  	int index = name.lastIndexOf('.');
  	if (index == -1) return null;
  	return name.substring(index + 1).trim();
      }
docs: get file extension of a file object
  
  @param file file object
  @return extension