static boolean match(char [] name, char [] pattern) {
        int ni = 0;
        int pi = 0;

        while (ni < name.length && pi < pattern.length) {
            if (name[ni] == pattern[pi]) {
                ni++;
                pi++;
            } else if (pattern[pi] == '*') {
                pi++;
                while (ni < name.length && name[ni] != '/') {
                    ni++;
                }
                if (pi < pattern.length && pattern[pi] == '*') {
                    pi++;
                    ni = name.length;
                }
            } else {
                return false;
            }
        }
        while (pi < pattern.length && pattern[pi] == '*') {
            pi++;
        }
        return ((ni == name.length) && (pi == pattern.length));
    }
Match a single name against a pattern.
A pattern can contain '*' to match until the next '/' separator,
and end with '**' to match the rest of the name.
Note that this isn't quite globbing, as there is no backtracking.

@param name the name
@param pattern the pattern
@return true if the name matches the pattern
jrt/src/com/yahoo/jrt/slobrok/api/Mirror.java