Serialization

Ok, im implementing Serializable from java.io.* and its working fine. My problem is relating to re-testing my use case. At the minute, when i want to run my use case using a new file input and output stream, I have to go and physically delete the data files that ive created by coming out of eclipse and into finder (running on a mac but same as explorer on pc) and im finding this quite tedious when i have to do it a number of times.

Is there a nifty piece of code or perhaps a better way to delete the data files? Perhaps something I can put into my use case that I can comment out & in again as per necessary (is this normal)? Very new to file handling by the way, hope that makes sense.

Thanks

[721 byte] By [B_Reala] at [2007-11-27 3:29:24]
# 1
Maybe java.io.File.delete() !
sabre150a at 2007-7-12 8:32:20 > top of Java-index,Java Essentials,Java Programming...
# 2
Doesnt seem to like it anywhere. Should that go in my use case or in the code for the class that the file I want to delete is in? Do I have to write the method delete?
B_Reala at 2007-7-12 8:32:20 > top of Java-index,Java Essentials,Java Programming...
# 3

> Doesnt seem to like it anywhere.

That's because you're probably using it wrong.

new File("filename.ext").delete();

> Should that go in my

> use case or in the code for the class that the file I

> want to delete is in?

Whereever you feel you want to keep it, although putting it in the class it's going to delete sounds a bit odd.

> Do I have to write the method delete?

You better let the operating system handle it, I'm not so sure you'd do a very good job with it.

-Kayaman-a at 2007-7-12 8:32:20 > top of Java-index,Java Essentials,Java Programming...