code: public static final FileAttribute<?>[] getFileAttributes(String perms)
      {
          if (perms.length() != 10)
          {
              throw new IllegalArgumentException(perms+" not permission. E.g. -rwxr--r--");
          }
          if (supports("posix"))
          {
              Set<PosixFilePermission> posixPerms = PosixFilePermissions.fromString(perms.substring(1));
              FileAttribute<Set<PosixFilePermission>> attrs = PosixFilePermissions.asFileAttribute(posixPerms);
              return new FileAttribute<?>[]{attrs};
          }
          else
          {
              return new FileAttribute<?>[]{};
          }
      }
docs: Returns PosixFileAttributes for perms
  <p>
  If posix is not supported returns empty array;
  @param perms E.g. -rwxr--r--
  @return