code: public void chmod(String chmod) {
  
      CharSequenceScanner parse = new CharSequenceScanner(chmod);
      if (!parse.hasNext()) {
        throw new IllegalArgumentException();
      }
      int mask = this.maskBits;
      try {
        int octal = parseOctalMode(parse);
        if (octal == -1) {
          // no digits are available in parse...
          while (parse.hasNext()) {
            mask = parseSymbolicMode(parse, mask);
            char c = parse.forceNext();
            if ((c != ',') && (c != 0)) {
              throw new IllegalArgumentException("'" + c + "'");
            }
          }
        } else {
          mask = octal;
          char c = parse.forceNext();
          if (c != 0) {
            throw new IllegalArgumentException("'" + c + "'");
          }
        }
      } catch (IllegalArgumentException e) {
        throw new IllegalArgumentException("Illegal chmod: " + chmod, e);
      }
      this.maskBits = mask;
    }
docs: This method allows to change the {@link #getMaskBits() modifiers} by a string expression. It behaves like the GNU
  command {@code chmod} (change modifiers). <br>
  Examples:<br>
  <ul>
  <li>{@code 0124}<br>
  sets the {@link #getMaskBits() modifiers} to {@code --x-w-r--}</li>
  <li>{@code u=wx,g+w,o-r}<br>
  sets the {@link #getMaskBits() modifiers} to {@code -wx?w?-??}</li>
  </ul>
  
  @param chmod is the mode-list argument as supplied to the {@code chmod} command. It can either be a single
  octal-mode (up to 4 digits of octal number) or a comma-separated list of symbolic-modes (
  {@code [ugoa]*([-+=]([rwxXst]*|[ugo]))+}).