Examples of CharArraySegment


Examples of org.apache.portals.applications.webcontent.util.CharArraySegment

        line = linkBasePathMatcher.replaceAll("$1$2($3" + defaultRemoteURLReplaces + "$4$3)");
       
        // if there's any https? absolute url link, try to find the proxy path mapper again...
        if (lookUpAllMappings)
        {
            CharSequence segment = new CharArraySegment(line);
           
            for (Matcher absURLMatcher = IMPORT_URL_ABS_URL_PATTERN.matcher(segment); absURLMatcher.find(); )
            {
                HttpReverseProxyPathMapper proxyMapper = null;
                String absURL = absURLMatcher.group(4);
                int maxMatchingPathPartCount = getMaxMatchingPathPartCount();
                String [] pathParts = StringUtils.split(absURL, "/", maxMatchingPathPartCount + 2);
                int pathPartCount = (pathParts != null ? pathParts.length : 0);
               
                if (pathPartCount < 2)
                {
                    continue;
                }
               
                String scheme = pathParts[0];
               
                for (int i = Math.min(pathPartCount, maxMatchingPathPartCount + 1); i > 1; i--)
                {
                    String remoteBaseURLKey = scheme + "//" + StringUtils.join(pathParts, "/", 1, i);
                   
                    if (blacklist != null && blacklist.contains(remoteBaseURLKey))
                    {
                        continue;
                    }

                    proxyMapper = getHttpReverseProxyPathMapperProvider().findMapperByRemoteURL(remoteBaseURLKey + "/");
                   
                    if (proxyMapper == null)
                    {
                        blacklist.add(remoteBaseURLKey);
                    }
                    else
                    {
                        Pattern pattern = remoteImportURLMatchingPatternMap.get(proxyMapper);
                        if (pattern == null)
                        {
                            pattern = createRemoteImportURLMatchingPattern(proxyMapper);
                            remoteImportURLMatchingPatternMap.put(proxyMapper, pattern);
                        }
                       
                        String replaces = localPathMatchingReplacesMap.get(proxyMapper);
                        if (replaces == null)
                        {
                            replaces = createLocalPathMatchingReplaces(proxyMapper);
                            localPathMatchingReplacesMap.put(proxyMapper, replaces);
                        }
                       
                        Matcher matcher = pattern.matcher(line);
                        line = replaceRemoteImportLinkValues(matcher, "$1$2($3" + replaces + "$6$3)", line);
                       
                        break;
                    }
                }
               
                segment = segment.subSequence(absURLMatcher.end(), segment.length());
                absURLMatcher.reset(segment);
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.portals.applications.webcontent.util.CharArraySegment

        line = linkBasePathMatcher.replaceAll("$1$2=$3" + defaultRemoteURLReplaces + "$4$3");
       
        // if there's any https? absolute url link, try to find the proxy path mapper again...
        if (lookUpAllMappings)
        {
            CharSequence segment = new CharArraySegment(line);
           
            for (Matcher absURLMatcher = LINK_HTTP_ABS_URL_PATTERN.matcher(segment); absURLMatcher.find(); )
            {
                HttpReverseProxyPathMapper proxyMapper = null;
                String absURL = absURLMatcher.group(3);
                int maxMatchingPathPartCount = getMaxMatchingPathPartCount();
                String [] pathParts = StringUtils.split(absURL, "/", maxMatchingPathPartCount + 2);
                int pathPartCount = (pathParts != null ? pathParts.length : 0);
               
                if (pathPartCount < 2)
                {
                    continue;
                }
               
                String scheme = pathParts[0];
               
                for (int i = Math.min(pathPartCount, maxMatchingPathPartCount + 1); i > 1; i--)
                {
                    String remoteBaseURLKey = scheme + "//" + StringUtils.join(pathParts, "/", 1, i);
                   
                    if (blacklist != null && blacklist.contains(remoteBaseURLKey))
                    {
                        continue;
                    }

                    proxyMapper = getHttpReverseProxyPathMapperProvider().findMapperByRemoteURL(remoteBaseURLKey + "/");
                   
                    if (proxyMapper == null)
                    {
                        blacklist.add(remoteBaseURLKey);
                    }
                    else
                    {
                        Pattern pattern = remoteURLMatchingPatternMap.get(proxyMapper);
                        if (pattern == null)
                        {
                            pattern = createRemoteURLMatchingPattern(proxyMapper);
                            remoteURLMatchingPatternMap.put(proxyMapper, pattern);
                        }
                       
                        String replaces = localPathMatchingReplacesMap.get(proxyMapper);
                        if (replaces == null)
                        {
                            replaces = createLocalPathMatchingReplaces(proxyMapper);
                            localPathMatchingReplacesMap.put(proxyMapper, replaces);
                        }
                       
                        Matcher matcher = pattern.matcher(line);
                        line = replaceRemoteLinkValues(matcher, "$1$2=$3" + replaces + "$6$3", line);
                       
                        break;
                    }
                }
               
                segment = segment.subSequence(absURLMatcher.end(), segment.length());
                absURLMatcher.reset(segment);
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.portals.applications.webcontent.util.CharArraySegment

        line = linkBasePathMatcher.replaceAll("$1$2=$3" + defaultRemoteURLReplaces + "$4$3");
       
        // if there's any https? absolute url link, try to find the proxy path mapper again...
        if (lookUpAllMappings)
        {
            CharSequence segment = new CharArraySegment(line);
           
            for (Matcher absURLMatcher = LINK_HTTP_ABS_URL_PATTERN.matcher(segment); absURLMatcher.find(); )
            {
                HttpReverseProxyPathMapper proxyMapper = null;
                String absURL = absURLMatcher.group(3);
                int maxMatchingPathPartCount = getMaxMatchingPathPartCount();
                String [] pathParts = StringUtils.split(absURL, "/", maxMatchingPathPartCount + 2);
                int pathPartCount = (pathParts != null ? pathParts.length : 0);
               
                if (pathPartCount < 2)
                {
                    continue;
                }
               
                String scheme = pathParts[0];
               
                for (int i = Math.min(pathPartCount, maxMatchingPathPartCount + 1); i > 1; i--)
                {
                    String remoteBaseURLKey = scheme + "//" + StringUtils.join(pathParts, "/", 1, i);
                   
                    if (blacklist != null && blacklist.contains(remoteBaseURLKey))
                    {
                        continue;
                    }

                    proxyMapper = getHttpReverseProxyPathMapperProvider().findMapperByRemoteURL(remoteBaseURLKey + "/");
                   
                    if (proxyMapper == null)
                    {
                        if (blacklist == null)
                        {
                            blacklist = new HashSet<String>();
                        }
                       
                        blacklist.add(remoteBaseURLKey);
                    }
                    else
                    {
                        if (remoteURLMatchingPatternMap == null)
                        {
                            remoteURLMatchingPatternMap = new HashMap<HttpReverseProxyPathMapper, Pattern>();
                            localPathMatchingReplacesMap = new HashMap<HttpReverseProxyPathMapper, String>();
                        }
                       
                        Pattern pattern = remoteURLMatchingPatternMap.get(proxyMapper);
                        if (pattern == null)
                        {
                            pattern = createRemoteURLMatchingPattern(proxyMapper);
                            remoteURLMatchingPatternMap.put(proxyMapper, pattern);
                        }
                       
                        String localPathMatchingReplaces = localPathMatchingReplacesMap.get(proxyMapper);
                        if (localPathMatchingReplaces == null)
                        {
                            localPathMatchingReplaces = createLocalPathMatchingReplaces(proxyMapper);
                            localPathMatchingReplacesMap.put(proxyMapper, localPathMatchingReplaces);
                        }
                       
                        Matcher matcher = pattern.matcher(line);
                        line = replaceRemoteLinkValues(matcher, "$1$2=$3" + localPathMatchingReplaces + "$6$3", line);
                       
                        break;
                    }
                }
               
                segment = segment.subSequence(absURLMatcher.end(), segment.length());
                absURLMatcher.reset(segment);
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.portals.applications.webcontent.util.CharArraySegment

        line = linkBasePathMatcher.replaceAll("$1$2($3" + defaultRemoteURLReplaces + "$4$3)");
       
        // if there's any https? absolute url link, try to find the proxy path mapper again...
        if (lookUpAllMappings)
        {
            CharSequence segment = new CharArraySegment(line);
           
            for (Matcher absURLMatcher = IMPORT_URL_ABS_URL_PATTERN.matcher(segment); absURLMatcher.find(); )
            {
                HttpReverseProxyPathMapper proxyMapper = null;
                String absURL = absURLMatcher.group(4);
                int maxMatchingPathPartCount = getMaxMatchingPathPartCount();
                String [] pathParts = StringUtils.split(absURL, "/", maxMatchingPathPartCount + 2);
                int pathPartCount = (pathParts != null ? pathParts.length : 0);
               
                if (pathPartCount < 2)
                {
                    continue;
                }
               
                String scheme = pathParts[0];
               
                for (int i = Math.min(pathPartCount, maxMatchingPathPartCount + 1); i > 1; i--)
                {
                    String remoteBaseURLKey = scheme + "//" + StringUtils.join(pathParts, "/", 1, i);
                   
                    if (blacklist != null && blacklist.contains(remoteBaseURLKey))
                    {
                        continue;
                    }

                    proxyMapper = getHttpReverseProxyPathMapperProvider().findMapperByRemoteURL(remoteBaseURLKey + "/");
                   
                    if (proxyMapper == null)
                    {
                        blacklist.add(remoteBaseURLKey);
                    }
                    else
                    {
                        Pattern pattern = remoteImportURLMatchingPatternMap.get(proxyMapper);
                        if (pattern == null)
                        {
                            pattern = createRemoteImportURLMatchingPattern(proxyMapper);
                            remoteImportURLMatchingPatternMap.put(proxyMapper, pattern);
                        }
                       
                        String replaces = localPathMatchingReplacesMap.get(proxyMapper);
                        if (replaces == null)
                        {
                            replaces = createLocalPathMatchingReplaces(proxyMapper);
                            localPathMatchingReplacesMap.put(proxyMapper, replaces);
                        }
                       
                        Matcher matcher = pattern.matcher(line);
                        line = replaceRemoteImportLinkValues(matcher, "$1$2($3" + replaces + "$6$3)", line);
                       
                        break;
                    }
                }
               
                segment = segment.subSequence(absURLMatcher.end(), segment.length());
                absURLMatcher.reset(segment);
            }
        }
        else
        {
View Full Code Here

Examples of org.apache.portals.applications.webcontent.util.CharArraySegment

        line = linkBasePathMatcher.replaceAll("$1$2=$3" + defaultRemoteURLReplaces + "$4$3");
       
        // if there's any https? absolute url link, try to find the proxy path mapper again...
        if (lookUpAllMappings)
        {
            CharSequence segment = new CharArraySegment(line);
           
            for (Matcher absURLMatcher = LINK_HTTP_ABS_URL_PATTERN.matcher(segment); absURLMatcher.find(); )
            {
                HttpReverseProxyPathMapper proxyMapper = null;
                String absURL = absURLMatcher.group(3);
                int maxMatchingPathPartCount = getMaxMatchingPathPartCount();
                String [] pathParts = StringUtils.split(absURL, "/", maxMatchingPathPartCount + 2);
                int pathPartCount = (pathParts != null ? pathParts.length : 0);
               
                if (pathPartCount < 2)
                {
                    continue;
                }
               
                String scheme = pathParts[0];
               
                for (int i = Math.min(pathPartCount, maxMatchingPathPartCount + 1); i > 1; i--)
                {
                    String remoteBaseURLKey = scheme + "//" + StringUtils.join(pathParts, "/", 1, i);
                   
                    if (blacklist != null && blacklist.contains(remoteBaseURLKey))
                    {
                        continue;
                    }

                    proxyMapper = getHttpReverseProxyPathMapperProvider().findMapperByRemoteURL(remoteBaseURLKey + "/");
                   
                    if (proxyMapper == null)
                    {
                        blacklist.add(remoteBaseURLKey);
                    }
                    else
                    {
                        Pattern pattern = remoteURLMatchingPatternMap.get(proxyMapper);
                        if (pattern == null)
                        {
                            pattern = createRemoteURLMatchingPattern(proxyMapper);
                            remoteURLMatchingPatternMap.put(proxyMapper, pattern);
                        }
                       
                        String replaces = localPathMatchingReplacesMap.get(proxyMapper);
                        if (replaces == null)
                        {
                            replaces = createLocalPathMatchingReplaces(proxyMapper);
                            localPathMatchingReplacesMap.put(proxyMapper, replaces);
                        }
                       
                        Matcher matcher = pattern.matcher(line);
                        line = replaceRemoteLinkValues(matcher, "$1$2=$3" + replaces + "$6$3", line);
                       
                        break;
                    }
                }
               
                segment = segment.subSequence(absURLMatcher.end(), segment.length());
                absURLMatcher.reset(segment);
            }
        }
        else
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.