title: Get SMB Shared Files Name and Permissions In Java
body: <p>I want to connect to an SMB server and browse through its files, and for a given path, to be able to retrieve a list of files and folders, with the names and permissions.</p>
  
  <p>I need to support all SMB dialects, and to be able to do it from my code.</p>
  
  <p>The code would like roughly as follows:</p>
  
  <pre><code>smbClient.connect(serverInfo);
  info = smbClient.getShare(shareName);
  for(File file : info.getFiles) {
      List&lt;permission&gt; permissions = file.getPermissions();
      //do something
  }
  </code></pre>
  
  <p>I've tried a few options such as <a href="https://github.com/hierynomus/smbj" rel="nofollow noreferrer">smbj</a>, <a href="https://github.com/CoreSecurity/impacket" rel="nofollow noreferrer">impacket</a>, <a href="https://nmap.org/" rel="nofollow noreferrer">nmap</a>, <a href="https://www.samba.org/samba/docs/current/man-html/smbclient.1.html" rel="nofollow noreferrer">samba</a> but none of them seem to fill my requirements above.</p>
  
  <p>Is there any way to achieve the above, using Java, Python, or any linux CLI which i can call from my Java code?</p>