Java 25 introduces significant changes regarding file operations on Windows, notably affecting the File.delete command's interaction with read-only files. As per Oracle's David Delabassee, File.delete will now return false for attempts to delete read-only files, a shift from previous behavior where files were deleted after modifying their attributes. This change aims for consistency and reliability, addressing issues where files might remain with changed attributes. To assist developers, a system property allows for restoration of the old behavior temporarily while updates are made.
In the planned Java 25 release, the File.delete command on Windows will not delete read-only files, necessitating changes in how applications handle such files.
Oracle’s David Delabassee confirms that the modification to File.delete in JDK 25 prevents deletion of read-only files to avoid inconsistent file states post-operation.
Collection
[
|
...
]