public static boolean isInvalidPath()

in src/main/java/org/apache/sling/servlets/resolver/internal/SlingServletResolver.java [776:796]


    public static boolean isInvalidPath(final String path) {
        int index = 0;
        while (index < path.length()) {
            int charCount = 0;
            int dotCount = 0;
            // count dots (".") and total chars in each path segment (between two '/')
            while (index < path.length() && path.charAt(index) != '/') {
                if (path.charAt(index) == '.') {
                    dotCount++;
                }
                charCount++;
                index++;
            }
            // if all chars are dots (".") and there are more than two dots, then the path is rejected
            if (charCount > 2 && dotCount == charCount) {
                return true;
            }
            index++;
        }
        return false;
    }