linux - How to retrieve Java NIO PosixFilePermission during a Files.walkFileTree? -
on unix, files.walkfiletree callback filevisitor.visitfile basicfileattributes sun.nio.fs.unixfileattributes$unixasbasicfileattributes. debugger shows, wrapped unixfileattributes contain permission information (st_mode field populated). there (graceful) way unwrap unixfileattributes$unixasbasicfileattributes in order @ least posixfileattributes permissions accessible? reflection not work me, results in illegalaccesserror when trying invoke unixfileattributes$unixasbasicfileattributes.unwrap.
also, want avoid explicitly call files.getposixfilepermissions(file) every reported file gives 10% overhead test cases.
Comments
Post a Comment