When I executed my java class it turned out that I don’t have some privileges when I try to access a file and I’ve got false:
file.canRead()
In order to get necessary rights I want to know who executes my code, I mean username who runs java class.
In a (desktop or web) application it would be simply:
A web application could be run under another user (with care).
In a WebStart application, run over the internet, there is a sandbox, i.e. asking the client to allow file system access.