code: public static Resource temporaryFile(String name, String extension) throws IOException {
        return new FileResource(File.createTempFile(name, extension));
     }
docs: Creates a resource wrapping a temporary file
  
  @param name      The file name
  @param extension The file extension
  @return The resource representing the temporary file
  @throws IOException the io exception