Does Files.createTempDirectory remove the directory after JVM exits normally?

前端 未结 5 810
滥情空心
滥情空心 2020-12-15 04:06

Does Files.createTempDirectory remove the directory after JVM exits normally? Or do I need to manually recursively remove the temporary directory content?

5条回答
  •  眼角桃花
    2020-12-15 04:41

    No it doesn't - createTempDirectory

    As with the createTempFile methods, this method is only part of a temporary-file facility. A shutdown-hook, or the File.deleteOnExit() mechanism may be used to delete the directory automatically.

提交回复
热议问题