Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
終わったら削除するということですが、すべての可能性をカバーし、ゴミを残す可能性を排除したいと考えています。File.createTempFile について読みましたが、VM が停止した後にのみ一時ファイルが削除されます...
ファイルが保存されているフォルダーを指定できる場合は、1 時間ごとに実行され、1 時間以上経過したファイルを削除するスケジュールされたタスクを作成できます。
@Scheduled アノテーションを見てください。