You can try opening the file, writing random bytes toThat wouldn't be sufficient because you can't be sure that the new data will be written over the top of the old data, e.g. flash drives with wear-leveling. Journaling file systems would also have the same problem. To do it properly you need low-level hardware access that Java can't provide.
a file, closing it, deleting it.
write random, and repeating bytes to it in a few
iterations just to make sure.