Name: rmT116609 Date: 11/12/2003
A DESCRIPTION OF THE REQUEST :
if java.io.File.delete() fails, the result value is false. there is no further information about the reason why it failed. it would be better that this method would throw a IOException with the reason why it failed. (in my case, it failed because another process still had a reference to the file.)
JUSTIFICATION :
with the current behaviour (just return false if delete() failed) there is no information why the deletion failed.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
e.g. if the file can't be deleted because it's still in access by another process, don't just return false but throw an IOException with the reason (e.g. "File is still referenced by another process.")
ACTUAL -
the method just returns false.
---------- BEGIN SOURCE ----------
File file = new File("readme.txt");
boolean result = file.delete();
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
you have to guess the reason why delete() failed.
(Incident Review ID: 225294)
======================================================================
A DESCRIPTION OF THE REQUEST :
if java.io.File.delete() fails, the result value is false. there is no further information about the reason why it failed. it would be better that this method would throw a IOException with the reason why it failed. (in my case, it failed because another process still had a reference to the file.)
JUSTIFICATION :
with the current behaviour (just return false if delete() failed) there is no information why the deletion failed.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
e.g. if the file can't be deleted because it's still in access by another process, don't just return false but throw an IOException with the reason (e.g. "File is still referenced by another process.")
ACTUAL -
the method just returns false.
---------- BEGIN SOURCE ----------
File file = new File("readme.txt");
boolean result = file.delete();
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
you have to guess the reason why delete() failed.
(Incident Review ID: 225294)
======================================================================
- duplicates
-
JDK-4313887 New I/O: Improved filesystem interface
- Resolved