code: private int findIndexOfUnglobbedPart(String globExpression) {
          int result = -1;
          for (int i = 0; i < globExpression.length(); i++) {
              switch (globExpression.charAt(i)) {
                  case '/':
                  case '\\':
                      result = i;
                      break;
                  case '*':
                      return result;
                  default:
              }
          }
          // There is apparently no wildcard in the path, let the directory part be the path
          // and the glob part only the filename
          return result;
      }
docs: This method computes the index of the last separator that splits
  the given glob expression into a leading part not containing wildcards
  and a trailing part containing wildcards.
  The last part of the path will never be counted to the leading part.
  
  <p>Example</p>
  <code><pre>
  src/main/asciidoc/*.adoc
  ^ 17
  /tmp/test.adoc
  ^ 4
  /test.adoc
  ^ 0
  *.adoc
  ^ -1
  </pre></code>
  
  @param globExpression e.g. {@code src/main/asciidoc/*.adoc}, {@code *.adoc},
  {@code /tmp/test.adoc}
  @return The index of the last separator char that splits the string into an unglobbed and a globbed part.
  If there is no unglobbed part or the string is only a file name the method returns {@code -1}