I'm developing an desktop application in JAVA (J2SE).
my App. stores some data about users.
the App. is multi user and will be installed on a single station.
each user can have some documents that should be stored in file-system (e.g. image, audio, ...)
I need to protect these files from be accessed directly by unauthorised users.
Users are defined in app itself (i need files be accessible only via application)
How can I protect these files from unauthorised access?
I thought about storing files in another system and access them via network.
How Can I do this (store/ retrieve files in a secured network computer) in JAVA?
Is this a good method? any better solution?
Thanks
EDIT:
decription:
My users are defined in application: all users use same computer; all users login with the same username in OS; each user logs in app with their own user/pass; each user should have access to files that application decides.
So users must not be able to open a file-manager and traverse through directories that files are stored in & copy them (while doesn't have access to them)
Instead of rolling out your own security solution - which will be cumbersome, almost certainly buggy, and with a high probability vulnerable to various attacks - simply use the Operating System's filesystem permission.
The easiest way to do that is to write your user data to the home directory of the current user. Other users will not be able to access it unless the user explicitly configures the directory's permissions to allow them.
If you want, you can also further restrict the permissions of your directory.