code: public static boolean isFile(Resource file) {
  	if (file.exists()) return file.isFile();
  	Resource parent = file.getParentResource();
  	return parent.mkdirs() && file.createNewFile();
      }
docs: checks if file is a file or not, if file doesn't exist, it will be created
  
  @param file
  @return is file or not