you could have a look at this (not java related) post - https://unix.stackexchange.com/questions/20104/is-there-any-way-to-prevent-deletion-of-certain-files-from-user-owned-directory.
it contains 2 solutions - either chowning the file by root and setting the sticky bit or using ext2/3/4 specific attributes.
both of these solutions are doable from java using System.exec()