code: private static String permsPart(String perms)
      {
          int length = perms.length();
          if (length > 10 || length < 9)
          {
              throw new IllegalArgumentException(perms+" not permission. E.g. -rwxr--r--");
          }
          return length == 10 ? perms.substring(1) : perms;
      }
docs: Returns permission part of mode string
  @param perms
  @return