spring-projects / spring-projects/spring-boot

Review use of File.createTempFile

Open
#21,519 4 comments 20 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

See #8578 for background

We currently have a few places in Spring Boot where we create temporary folders without the ability to opt-out. We should review these for users that wish to create immutable containers.

We can't make any guarantees that it will always possible to run an immutable container, we can only ensure that Spring Boot itself can run without creating temporary files. For example, we could update UndertowServletWebServerFactory so that it doesn't call deployment.setTempDir, but we can't guarantee that DeploymentInfo.requireTempPath() isn't called when the container runs (e.g. because of multi-part uploads).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing UndertowServletWebServerFactory and its use of deployment.setTempDir, then search for the other temporary-folder creation sites described in the issue. Compare them with DeploymentInfo.requireTempPath() and identify changes that let Spring Boot run without creating temporary files, while documenting the container limitations noted in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.