title: How to retrieve Java NIO PosixFilePermission during a Files.walkFileTree?
body: <p>On Unix, <code>Files.walkFileTree</code> will callback <code>FileVisitor.visitFile</code> with <code>BasicFileAttributes</code> which are actually <code>sun.nio.fs.UnixFileAttributes$UnixAsBasicFileAttributes</code>. As the debugger shows, the wrapped <code>UnixFileAttributes</code> already contain permission information (<code>st_mode</code> field is populated). Is there a (graceful) way to <em>unwrap</em> the <code>UnixFileAttributes$UnixAsBasicFileAttributes</code> in order to get at least <code>PosixFileAttributes</code> so the permissions will be accessible? Reflection does not work for me, but results in an <code>IllegalAccessError</code> when trying to invoke <code>UnixFileAttributes$UnixAsBasicFileAttributes.unwrap</code>.</p>
  
  <p>Also, I want to avoid to explicitly call <code>Files.getPosixFilePermissions(file)</code> for every reported file as this gives roughly 10% overhead for my test cases.</p>