-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
8u66
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
The documentation states that File.deleteOnExit is "Replaced by the DELETE_ON_CLOSE option specified in the createFile method."
However, the Files.createFile method does not accept the DELETE_ON_CLOSE option. It takes FileAttributes as optional parameters, but not OpenOptions.
Furthermore, the DELETE_ON_CLOSE mechanism is not the same thing as File.deleteOnExit anyway. There is no equivalent of deleteOnExit in the nio API.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect something along the lines of:
"There is no equivalent of File.deleteOnExit. However, one can specify the DELETE_ON_CLOSE option when opening a file for reading and/or writing."
ACTUAL -
"File.deleteOnExit : Replaced by the DELETE_ON_CLOSE option specified in the createFile method"
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/tutorial/essential/io/legacy.html#mapping
The documentation states that File.deleteOnExit is "Replaced by the DELETE_ON_CLOSE option specified in the createFile method."
However, the Files.createFile method does not accept the DELETE_ON_CLOSE option. It takes FileAttributes as optional parameters, but not OpenOptions.
Furthermore, the DELETE_ON_CLOSE mechanism is not the same thing as File.deleteOnExit anyway. There is no equivalent of deleteOnExit in the nio API.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would expect something along the lines of:
"There is no equivalent of File.deleteOnExit. However, one can specify the DELETE_ON_CLOSE option when opening a file for reading and/or writing."
ACTUAL -
"File.deleteOnExit : Replaced by the DELETE_ON_CLOSE option specified in the createFile method"
URL OF FAULTY DOCUMENTATION :
https://docs.oracle.com/javase/tutorial/essential/io/legacy.html#mapping