code: public static final String getModeString(Path path) throws IOException
      {
          char letter = getFileTypeLetter(path);
          if (supports("posix"))
          {
              Set<PosixFilePermission> perms = Files.getPosixFilePermissions(path);
              return letter+PosixFilePermissions.toString(perms);
          }
          else
          {
              switch (letter)
              {
                  case '-':
                      return "-rw-r--r--";
                  case 'd':
                      return "drwxr-xr-x";
                  case 'l':
                      return "drw-r--r--";
              }
          }
          throw new UnsupportedOperationException("should not happen");
      }
docs: Returns  mode string for path. Real mode for linux. Others guess work.
  @param path
  @return
  @throws IOException