Examples of PathMap

  • org.mortbay.jetty.servlet.PathMap
    URI path map to Object. This mapping implements the path specification recommended in the 2.2 Servlet API. Path specifications can be of the following forms:
     /foo/bar           - an exact path specification. /foo/*             - a prefix path specification (must end '/*'). *.ext              - a suffix path specification. /                  - the default path specification.        
    Matching is performed in the following order
  • Exact match.
  • Longest prefix match.
  • Longest suffix match.
  • default. Multiple path specifications can be mapped by providing a list of specifications. The list is separated by the characters specified in the "org.mortbay.http.PathMap.separators" System property, which defaults to :

    Special characters within paths such as '?� and ';' are not treated specially as it is assumed they would have been either encoded in the original URL or stripped from the path.

    This class is not synchronized for get's. If concurrent modifications are possible then it should be synchronized at a higher level. @author Greg Wilkins (gregw)

  • org.openqa.jetty.http.PathMap
    URI path map to Object. This mapping implements the path specification recommended in the 2.2 Servlet API. Path specifications can be of the following forms:
     /foo/bar           - an exact path specification. /foo/*             - a prefix path specification (must end '/*'). *.ext              - a suffix path specification. /                  - the default path specification.        
    Matching is performed in the following order
  • Exact match.
  • Longest prefix match.
  • Longest suffix match.
  • default. Multiple path specifications can be mapped by providing a list of specifications. The list is separated by the characters specified in the "org.openqa.jetty.http.PathMap.separators" System property, which defaults to :

    Note that this is a very different mapping to that provided by PathMap in Jetty2.

    This class is not synchronized for get's. If concurrent modifications are possible then it should be synchronized at a higher level. @version $Id: PathMap.java,v 1.25 2005/08/13 00:01:24 gregwilkins Exp $ @author Greg Wilkins (gregw)

  • org.pdf4j.saxon.expr.PathMap
    b.research.bell-labs.com/user/simeon/xml_projection.pdf">A. Marian and J. Simeon, Projecting XML Documents, VLDB 2003.


  • Examples of org.eclipse.jetty.http.PathMap

                {
                    List whiteList = (whiteObj instanceof List) ? (List)whiteObj : Collections.singletonList(whiteObj);

                    for (Object entry: whiteList)
                    {
                        PathMap pathMap = ((Map.Entry<String,PathMap>)entry).getValue();
                        if (match = (pathMap!=null && (pathMap.size()==0 || pathMap.match(path)!=null)))
                            break;
                    }
                }
               
                if (!match)
                    return false;
            }

            if (_black.size() > 0)
            {
                Object blackObj = _black.getLazyMatches(addr);
                if (blackObj != null)
                {
                    List blackList = (blackObj instanceof List) ? (List)blackObj : Collections.singletonList(blackObj);
       
                    for (Object entry: blackList)
                    {
                        PathMap pathMap = ((Map.Entry<String,PathMap>)entry).getValue();
                        if (pathMap!=null && (pathMap.size()==0 || pathMap.match(path)!=null))
                            return false;
                    }
                }
            }
           
    View Full Code Here

    Examples of org.eclipse.jetty.http.PathMap

            this.properties = properties;
            this.enabled = getBoolean("enabled", true);
            this.type = getString("type", "jetty");
            String ignorePaths = getString("ignorePaths", "");
            if (ignorePaths != null && ignorePaths.length() > 0) {
                ignorePathMap = new PathMap();
                for (String s : ignorePaths.split(",")) {
                    ignorePathMap.put(s, s);
                }
            }
            else {
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

        public void addAuthorization(String pathSpec,Authorization authorization)
        {
            synchronized (this)
            {
                if (_authorizations==null)
                    _authorizations=new PathMap();
                _authorizations.put(pathSpec,authorization);
            }
           
            // TODO query and remove methods
        }
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

        public void addRewriteRule(String pattern, String prefix)
        {
            if (pattern==null || pattern.length()==0 || !pattern.startsWith("/"))
                throw new IllegalArgumentException();
            if (_rewrite==null)
                _rewrite=new PathMap(true);
            _rewrite.put(pattern,prefix);
        }
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

        /**
         * Remap the context paths.
         */
        public void mapContexts()
        {
            PathMap contextMap = new PathMap();
            Handler[] branches = getHandlers();
           
           
            for (int b=0;branches!=null && b<branches.length;b++)
            {
                Handler[] handlers=null;
               
                if (branches[b] instanceof ContextHandler)
                {
                    handlers = new Handler[]{ branches[b] };
                }
                else if (branches[b] instanceof HandlerContainer)
                {
                    handlers = ((HandlerContainer)branches[b]).getChildHandlersByClass(ContextHandler.class);
                }
                else
                    continue;
               
                for (int i=0;i<handlers.length;i++)
                {
                    ContextHandler handler=(ContextHandler)handlers[i];

                    String contextPath=handler.getContextPath();

                    if (contextPath==null || contextPath.indexOf(',')>=0 || contextPath.startsWith("*"))
                        throw new IllegalArgumentException ("Illegal context spec:"+contextPath);

                    if(!contextPath.startsWith("/"))
                        contextPath='/'+contextPath;

                    if (contextPath.length()>1)
                    {
                        if (contextPath.endsWith("/"))
                            contextPath+="*";
                        else if (!contextPath.endsWith("/*"))
                            contextPath+="/*";
                    }

                    Object contexts=contextMap.get(contextPath);
                    String[] vhosts=handler.getVirtualHosts();

                   
                    if (vhosts!=null && vhosts.length>0)
                    {
                        Map hosts;

                        if (contexts instanceof Map)
                            hosts=(Map)contexts;
                        else
                        {
                            hosts=new HashMap();
                            hosts.put("*",contexts);
                            contextMap.put(contextPath, hosts);
                        }

                        for (int j=0;j<vhosts.length;j++)
                        {
                            String vhost=vhosts[j];
                            contexts=hosts.get(vhost);
                            contexts=LazyList.add(contexts,branches[b]);
                            hosts.put(vhost,contexts);
                        }
                    }
                    else if (contexts instanceof Map)
                    {
                        Map hosts=(Map)contexts;
                        contexts=hosts.get("*");
                        contexts= LazyList.add(contexts, branches[b]);
                        hosts.put("*",contexts);
                    }
                    else
                    {
                        contexts= LazyList.add(contexts, branches[b]);
                        contextMap.put(contextPath, contexts);
                    }
                }
            }
            _contextMap=contextMap;

    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

            Handler[] handlers = getHandlers();
            if (handlers==null || handlers.length==0)
          return;

      Request base_request = HttpConnection.getCurrentConnection().getRequest();
      PathMap map = _contextMap;
      if (map!=null && target!=null && target.startsWith("/"))
      {
          Object contexts = map.getLazyMatches(target);

                for (int i=0; i<LazyList.size(contexts); i++)
                {
                    Map.Entry entry = (Map.Entry)LazyList.get(contexts, i);
                    Object list = entry.getValue();
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

           
            _out = _fileOut;
           
            if (_ignorePaths != null && _ignorePaths.length > 0)
            {
                _ignorePathMap = new PathMap();
                for (int i = 0; i < _ignorePaths.length; i++)
                    _ignorePathMap.put(_ignorePaths[i], _ignorePaths[i]);
            }
            else
                _ignorePathMap = null;
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

        public void addAuthorization(String pathSpec,Authorization authorization)
        {
            synchronized (this)
            {
                if (_authorizations==null)
                    _authorizations=new PathMap();
                _authorizations.put(pathSpec,authorization);
            }

            // TODO query and remove methods
        }
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

           
            _out = _fileOut;
           
            if (_ignorePaths != null && _ignorePaths.length > 0)
            {
                _ignorePathMap = new PathMap();
                for (int i = 0; i < _ignorePaths.length; i++)
                    _ignorePathMap.put(_ignorePaths[i], _ignorePaths[i]);
            }
            else
                _ignorePathMap = null;
    View Full Code Here

    Examples of org.mortbay.jetty.servlet.PathMap

        /**
         * Remap the context paths.
         */
        public void mapContexts()
        {
            PathMap contextMap = new PathMap();
            Handler[] branches = getHandlers();
           
           
            for (int b=0;branches!=null && b<branches.length;b++)
            {
                Handler[] handlers=null;
               
                if (branches[b] instanceof ContextHandler)
                {
                    handlers = new Handler[]{ branches[b] };
                }
                else if (branches[b] instanceof HandlerContainer)
                {
                    handlers = ((HandlerContainer)branches[b]).getChildHandlersByClass(ContextHandler.class);
                }
                else
                    continue;
               
                for (int i=0;i<handlers.length;i++)
                {
                    ContextHandler handler=(ContextHandler)handlers[i];

                    String contextPath=handler.getContextPath();

                    if (contextPath==null || contextPath.indexOf(',')>=0 || contextPath.startsWith("*"))
                        throw new IllegalArgumentException ("Illegal context spec:"+contextPath);

                    if(!contextPath.startsWith("/"))
                        contextPath='/'+contextPath;

                    if (contextPath.length()>1)
                    {
                        if (contextPath.endsWith("/"))
                            contextPath+="*";
                        else if (!contextPath.endsWith("/*"))
                            contextPath+="/*";
                    }

                    Object contexts=contextMap.get(contextPath);
                    String[] vhosts=handler.getVirtualHosts();

                   
                    if (vhosts!=null && vhosts.length>0)
                    {
                        Map hosts;

                        if (contexts instanceof Map)
                            hosts=(Map)contexts;
                        else
                        {
                            hosts=new HashMap();
                            hosts.put("*",contexts);
                            contextMap.put(contextPath, hosts);
                        }

                        for (int j=0;j<vhosts.length;j++)
                        {
                            String vhost=vhosts[j];
                            contexts=hosts.get(vhost);
                            contexts=LazyList.add(contexts,branches[b]);
                            hosts.put(vhost,contexts);
                        }
                    }
                    else if (contexts instanceof Map)
                    {
                        Map hosts=(Map)contexts;
                        contexts=hosts.get("*");
                        contexts= LazyList.add(contexts, branches[b]);
                        hosts.put("*",contexts);
                    }
                    else
                    {
                        contexts= LazyList.add(contexts, branches[b]);
                        contextMap.put(contextPath, contexts);
                    }
                }
            }
            _contextMap=contextMap;

    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.