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 net.sf.saxon.expr.PathMap

          return this.xQuery.usesContextItem();
        }
       
      public void useDocumentProjection(List<XMLTable.XMLColumn> columns, AnalysisRecord record) {
        this.contextRoot = null;
        PathMap map = this.xQuery.getPathMap();
        PathMapRoot parentRoot;
        try {
          parentRoot = map.getContextRoot();
        } catch (IllegalStateException e) {
          if (record.recordDebug()) {
            record.println("Document projection will not be used, since multiple context item exist."); //$NON-NLS-1$
          }
          return;
    View Full Code Here

    Examples of net.sf.saxon.expr.PathMap

        for (XMLColumn xmlColumn : columns) {
          if (xmlColumn.isOrdinal()) {
            continue;
          }
            Expression internalExpression = xmlColumn.getPathExpression().getInternalExpression();
            PathMap subMap = new PathMap(internalExpression);
            PathMapRoot subContextRoot = null;
            for (PathMapRoot root : subMap.getPathMapRoots()) {
            if (root.getRootExpression() instanceof ContextItemExpression || root.getRootExpression() instanceof RootExpression) {
              if (subContextRoot != null) {
                if (record.recordDebug()) {
                  record.println("Document projection will not be used, since multiple context items exist in column path " + xmlColumn.getPath()); //$NON-NLS-1$
                }
                return null;
              }
              subContextRoot = root;
            }
          }
            if (subContextRoot == null) {
              //special case for handling '.', which the pathmap logic doesn't consider as a root
              if (internalExpression instanceof ContextItemExpression) {
                addReturnedArcs(xmlColumn, finalNode);
              }
              continue;
            }
            for (PathMapArc arc : subContextRoot.getArcs()) {
            finalNode.createArc(arc.getStep(), arc.getTarget());
          }
            HashSet<PathMapNode> subFinalNodes = new HashSet<PathMapNode>();
          getReturnableNodes(subContextRoot, subFinalNodes);
            for (PathMapNode subNode : subFinalNodes) {
              addReturnedArcs(xmlColumn, subNode);
              }
        }
        //Workaround to rerun the reduction algorithm - by making a copy of the old version
        PathMap newMap = new PathMap(DUMMY_EXPRESSION);
        PathMapRoot newRoot = newMap.makeNewRoot(parentRoot.getRootExpression());
        if (parentRoot.isAtomized()) {
          newRoot.setAtomized();
        }
        if (parentRoot.isReturnable()) {
          newRoot.setReturnable(true);
        }
        if (parentRoot.hasUnknownDependencies()) {
          newRoot.setHasUnknownDependencies();
        }
        for (PathMapArc arc : parentRoot.getArcs()) {
          newRoot.createArc(arc.getStep(), arc.getTarget());
        }
        return newMap.reduceToDownwardsAxes(newRoot);
      }
    View Full Code Here

    Examples of net.sf.saxon.expr.PathMap

                if (!exp.usesContextItem()) {
                    System.err.println("Source document ignored - query does not access the context item");
                    sourceInput = null;

                } else if (projection) {
                    PathMap map = exp.getPathMap();
                    PathMap.PathMapRoot contextRoot = map.getContextRoot();
                    if (explain) {
                        System.err.println("DOCUMENT PROJECTION: PATH MAP");
                        map.diagnosticDump(System.err);
                    }
                    if (contextRoot != null) {
                        if (contextRoot.hasUnknownDependencies()) {
                            System.err.println("Document projection for the context document is not possible, " +
                                    "because the query uses paths that defy analysis");
    View Full Code Here

    Examples of net.sf.saxon.expr.PathMap

                if ((!exp.usesContextItem())) {
                    System.err.println("Source document ignored - query does not access the context item");
                    sourceInput = null;

                } else if (projection) {
                    PathMap map = exp.getPathMap();
                    PathMap.PathMapRoot contextRoot = map.getContextRoot();
                    if (explain) {
                        System.err.println("DOCUMENT PROJECTION: PATH MAP");
                        map.diagnosticDump(System.err);
                    }
                    if (contextRoot != null) {
                        if (contextRoot.hasUnknownDependencies()) {
                            System.err.println("Document projection for the context document is not possible, " +
                                    "because the query uses paths that defy analysis");
    View Full Code Here

    Examples of org.eclipse.jetty.http.PathMap

    public class JettyPathMapTest {

      @Ignore( "This doesn't work like I expected." )
      @Test
      public void testPathMatching() {
        PathMap map = new PathMap();
        map.put( "/webhdfs", "/webhdfs" );
        map.put( "/webhdfs/dfshealth.jsp", "/webhdfs/dfshealth.jsp" );
        map.put( "/webhdfs/*", "/webhdfs/*" );

        assertThat( (String)map.match( "/webhdfs" ), equalTo( "/webhdfs" ) );
        assertThat( (String)map.match( "/webhdfs/dfshealth.jsp" ), equalTo( "/webhdfs/dfshealth.jsp" ) );
        assertThat( (String)map.match( "/webhdfs/v1" ), equalTo( "/webhdfs/*" ) );
      }
    View Full Code Here

    Examples of org.eclipse.jetty.http.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.eclipse.jetty.http.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.eclipse.jetty.http.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.eclipse.jetty.http.PathMap

     
      // data structure which maps a request to a context; first-best match wins
      // { context path =>
      //     { virtual host => context }
      // }
      PathMap map = _contextMap;
      if (map!=null && target!=null && target.startsWith("/"))
      {
          // first, get all contexts matched by context path
          Object contexts = map.getLazyMatches(target);

                for (int i=0; i<LazyList.size(contexts); i++)
                {
                    // then, match against the virtualhost of each context
                    Map.Entry entry = (Map.Entry)LazyList.get(contexts, i);
    View Full Code Here

    Examples of org.eclipse.jetty.http.PathMap

                if (addr.endsWith("."))
                    deprecated = true;
                if (path!=null && (path.startsWith("|") || path.startsWith("/*.")))
                    path=path.substring(1);
              
                PathMap pathMap = patternMap.get(addr);
                if (pathMap == null)
                {
                    pathMap = new PathMap(true);
                    patternMap.put(addr,pathMap);
                }
                if (path != null)
                    pathMap.put(path,path);
               
                if (deprecated)
                    LOG.debug(toString() +" - deprecated specification syntax: "+entry);
            }
        }
    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.