private void checkAccess(UnixPath file,boolean checkRead,boolean checkWrite){
  SecurityManager sm=System.getSecurityManager();
  if (sm != null) {
    if (checkRead)     file.checkRead();
    if (checkWrite)     file.checkWrite();
    sm.checkPermission(new RuntimePermission("accessUserInformation"));
  }
}

private void checkAccess ( UnixPath file , boolean checkRead , boolean checkWrite ) { SecurityManager sm = System . getSecurityManager ( ) ; if ( sm != null ) { if ( checkRead ) file . checkRead ( ) ; if ( checkWrite ) file . checkWrite ( ) ; sm . checkPermission ( new RuntimePermission ( "accessUserInformation" ) ) ; } }
permission checks to access file
