Search code examples
java-7sambanfsjcifsfileshare

How to get File Owner attribute from SAMBA (CIFS)?


In my developing code, i have to bring file owner attribute from SAMBA server "CIFS"- File Share. How would i can get it by using any API within JAVA.

Thank you in advance.


Solution

  • The JCIFS version 1.3.18 has a patch available to get the owner of a file.

    Link to the JCIFS java lib is : https://jcifs.samba.org/src/jcifs-1.3.18.jar

    Link to the patch file is :https://jcifs.samba.org/src/patches/GetOwnerSid.patch

    You have to get the source of the 1.3.18 version and then generate the JAR after applying the patch. Also, note that this patch does not resolve the SID of the owner. So you may want to add code to resolve the SID.