This discussion is archived
5 Replies Latest reply: Jun 13, 2007 5:17 PM by 807605 RSS

How to check whether a file got read permissions for perticular user

807605 Newbie
Currently Being Moderated
Problem: Let JRE is running with some x as effective user in LINUX then while checking file permission it is checking permission on that file for that x user.

File f = new File(�file name�)
if(f.exists())
{
     System.out.println(�exists�);
}
Else
{
     System.out.println(�does not exists�);
}
The above code prints exists only when x user have permissions on that file

Requirement: I would like to check whether a file got read permissions for particular user i.e. whether y user got permissions on that file.

Any help is appreciated