geronimo-javamail_1.3.1/geronimo-javamail_1.3.1_provider/src/main/java/org/apache/geronimo/javamail/store/nntp/NNTPRootFolder.java [342:397]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public boolean matches(String name) {

            // handle the easy cases first

            // full wildcard? Always matches
            if (matchAny) {
                return true;
            }

            // required exact matches are easy.
            if (exactMatch != null) {
                return exactMatch.equals(name);
            }

            int span = 0;

            // must match the beginning?
            if (firstSection != null) {
                // if it doesn't start with that, it can't be true.
                if (!name.startsWith(firstSection)) {
                    return false;
                }

                // we do all additional matching activity from here.
                span = firstSection.length();
            }

            // scan for each of the sections along the string
            for (int i = 1; i < matchSections.size(); i++) {
                // if a section is not found, this is false

                String nextMatch = (String) matchSections.get(i);
                int nextLocation = name.indexOf(nextMatch, span);
                if (nextLocation == -1) {
                    return false;
                }
                // step over that one
                span = nextMatch.length() + nextLocation;
            }

            // we've matched everything up to this point, now check to see if
            // need an end match
            if (lastSection != null) {
                // we need to have at least the number of characters of the end
                // string left, else this fails.
                if (name.length() - span < lastSection.length()) {
                    return false;
                }

                // ok, make sure we end with this string
                return name.endsWith(lastSection);
            }

            // no falsies, this must be the truth.
            return true;
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-mail_2.1/geronimo-mail_2.1_provider/src/main/java/org/apache/geronimo/mail/store/nntp/NNTPRootFolder.java [342:397]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public boolean matches(String name) {

            // handle the easy cases first

            // full wildcard? Always matches
            if (matchAny) {
                return true;
            }

            // required exact matches are easy.
            if (exactMatch != null) {
                return exactMatch.equals(name);
            }

            int span = 0;

            // must match the beginning?
            if (firstSection != null) {
                // if it doesn't start with that, it can't be true.
                if (!name.startsWith(firstSection)) {
                    return false;
                }

                // we do all additional matching activity from here.
                span = firstSection.length();
            }

            // scan for each of the sections along the string
            for (int i = 1; i < matchSections.size(); i++) {
                // if a section is not found, this is false

                String nextMatch = (String) matchSections.get(i);
                int nextLocation = name.indexOf(nextMatch, span);
                if (nextLocation == -1) {
                    return false;
                }
                // step over that one
                span = nextMatch.length() + nextLocation;
            }

            // we've matched everything up to this point, now check to see if
            // need an end match
            if (lastSection != null) {
                // we need to have at least the number of characters of the end
                // string left, else this fails.
                if (name.length() - span < lastSection.length()) {
                    return false;
                }

                // ok, make sure we end with this string
                return name.endsWith(lastSection);
            }

            // no falsies, this must be the truth.
            return true;
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.4/geronimo-javamail_1.4_provider/src/main/java/org/apache/geronimo/javamail/store/nntp/NNTPRootFolder.java [342:397]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public boolean matches(String name) {

            // handle the easy cases first

            // full wildcard? Always matches
            if (matchAny) {
                return true;
            }

            // required exact matches are easy.
            if (exactMatch != null) {
                return exactMatch.equals(name);
            }

            int span = 0;

            // must match the beginning?
            if (firstSection != null) {
                // if it doesn't start with that, it can't be true.
                if (!name.startsWith(firstSection)) {
                    return false;
                }

                // we do all additional matching activity from here.
                span = firstSection.length();
            }

            // scan for each of the sections along the string
            for (int i = 1; i < matchSections.size(); i++) {
                // if a section is not found, this is false

                String nextMatch = (String) matchSections.get(i);
                int nextLocation = name.indexOf(nextMatch, span);
                if (nextLocation == -1) {
                    return false;
                }
                // step over that one
                span = nextMatch.length() + nextLocation;
            }

            // we've matched everything up to this point, now check to see if
            // need an end match
            if (lastSection != null) {
                // we need to have at least the number of characters of the end
                // string left, else this fails.
                if (name.length() - span < lastSection.length()) {
                    return false;
                }

                // ok, make sure we end with this string
                return name.endsWith(lastSection);
            }

            // no falsies, this must be the truth.
            return true;
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.5/geronimo-javamail_1.5_provider/src/main/java/org/apache/geronimo/javamail/store/nntp/NNTPRootFolder.java [342:397]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public boolean matches(String name) {

            // handle the easy cases first

            // full wildcard? Always matches
            if (matchAny) {
                return true;
            }

            // required exact matches are easy.
            if (exactMatch != null) {
                return exactMatch.equals(name);
            }

            int span = 0;

            // must match the beginning?
            if (firstSection != null) {
                // if it doesn't start with that, it can't be true.
                if (!name.startsWith(firstSection)) {
                    return false;
                }

                // we do all additional matching activity from here.
                span = firstSection.length();
            }

            // scan for each of the sections along the string
            for (int i = 1; i < matchSections.size(); i++) {
                // if a section is not found, this is false

                String nextMatch = (String) matchSections.get(i);
                int nextLocation = name.indexOf(nextMatch, span);
                if (nextLocation == -1) {
                    return false;
                }
                // step over that one
                span = nextMatch.length() + nextLocation;
            }

            // we've matched everything up to this point, now check to see if
            // need an end match
            if (lastSection != null) {
                // we need to have at least the number of characters of the end
                // string left, else this fails.
                if (name.length() - span < lastSection.length()) {
                    return false;
                }

                // ok, make sure we end with this string
                return name.endsWith(lastSection);
            }

            // no falsies, this must be the truth.
            return true;
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-javamail_1.6/geronimo-javamail_1.6_provider/src/main/java/org/apache/geronimo/javamail/store/nntp/NNTPRootFolder.java [342:397]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public boolean matches(String name) {

            // handle the easy cases first

            // full wildcard? Always matches
            if (matchAny) {
                return true;
            }

            // required exact matches are easy.
            if (exactMatch != null) {
                return exactMatch.equals(name);
            }

            int span = 0;

            // must match the beginning?
            if (firstSection != null) {
                // if it doesn't start with that, it can't be true.
                if (!name.startsWith(firstSection)) {
                    return false;
                }

                // we do all additional matching activity from here.
                span = firstSection.length();
            }

            // scan for each of the sections along the string
            for (int i = 1; i < matchSections.size(); i++) {
                // if a section is not found, this is false

                String nextMatch = (String) matchSections.get(i);
                int nextLocation = name.indexOf(nextMatch, span);
                if (nextLocation == -1) {
                    return false;
                }
                // step over that one
                span = nextMatch.length() + nextLocation;
            }

            // we've matched everything up to this point, now check to see if
            // need an end match
            if (lastSection != null) {
                // we need to have at least the number of characters of the end
                // string left, else this fails.
                if (name.length() - span < lastSection.length()) {
                    return false;
                }

                // ok, make sure we end with this string
                return name.endsWith(lastSection);
            }

            // no falsies, this must be the truth.
            return true;
        }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



