How to know Access Permissions on a directory using Java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navajyothi
    New Member
    • Jul 2008
    • 1

    How to know Access Permissions on a directory using Java

    Does anyone know if there is a way to check the access
    permissions of different users using Java? I need to know
    if a user has full control or if they have read only
    access or none to a certain directory. I have seen
    different ways to set the permissions but none to read
    them. Any help would be appreciated. Thanks in advance.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Have a look at the methods of the File class.

    kind regards,

    Jos

    Comment

    • samido
      New Member
      • Oct 2007
      • 52

      #3
      try this:

      File fl = new File("Myfile");

      fl.canRead(); //returns boolean
      fl.canWrite(); //returns boolean
      --------------------------------------------------------------------------------------------

      Sam Rabophala

      Comment

      Working...