Package org.eclipse.jetty.http

Examples of org.eclipse.jetty.http.PathMap.match()


    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


    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

    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

                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)
View Full Code Here

                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

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.