Originally Posted by kazeopeia
So now I am hoping to find a way to password protect an existing file (any file) in linux instead (using java codes).
What exactly do you mean by "password protect"? Do you want only certain user (or a group of users) to have access to the file based on file permission settings, or do you wish for them to have to enter a 'password' before they are granted access? Perhaps you interested in encrypting the contents of the file? If the latter, look into the javax.crypto package.
It would be helpful if you clarify exactly what you require.