Java PosixFilePermission create from String "rw-rw-r--"

Description

Java PosixFilePermission create from String "rw-rw-r--"

import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.util.Set;

public class Main {

   public static void main(String[] args)  {
      Set<PosixFilePermission> permissions = PosixFilePermissions.fromString("rw-rw-r--");
      for (PosixFilePermission permission : permissions) {
         System.out.print(permission.toString() + ' ');
      }//w ww .  j av  a2s . c  om
      System.out.println();
   }

}



PreviousNext

Related