Home  >  Forum  >  Core Java
Post New Query

'posix:permissions' not supported as initial attribute


joined on
November 09,2013
Asked on November 28,2013
Hi All,
I am using   Files.createDirectories as

FileAttribute<Set<PosixFilePermission>> fileAttributes = PosixFilePermissions.asFileAttribute(perms);
 Files.createDirectories(path,fileAttributes);


But got below error.

Exception in thread "main" java.lang.UnsupportedOperationException: 'posix:permissions' not supported as initial attribute
    at sun.nio.fs.WindowsSecurityDescriptor.fromAttribute(Unknown Source)
    at sun.nio.fs.WindowsFileSystemProvider.createDirectory(Unknown Source)
    at java.nio.file.Files.createDirectory(Unknown Source)
    at java.nio.file.Files.createAndCheckIsDirectory(Unknown Source)
    at java.nio.file.Files.createDirectories(Unknown Source)

   
   
joined on
March 14,2013
Replied on November 29,2013

Hi Anil,

The error you have mentioned comes when PosixFilePermission is run on windows OS.
Windows does not support PosixFilePermission.

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us