Under what circumstances it works, and under what it does not?
Are you getting an exception when it doesn't work, and if it is the case can you post the message you get?
Well, none of these methods is throwing an exception (an oversight by my side, too).
You should try using new Files.delete(Path) (the class introduced in JDK 7). If something fails, you will get appropriate exception so you can know what went wrong. Check this tutorial.
The real problem was some where else. I mean I not closed the input and output stream that's why the file was not deleted. I properly closed them and it started to work fine
Thanks again & good night
Post by:autobot
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, that will fit in a stocking