private Map getContextForLongestPathPrefix( String url ) { Map context = _urlTree; ParsedPath path = new ParsedPath( url ); while (path.hasNext()) { String part = path.next(); if (!context.containsKey( part )) break; context = (Map) context.get( part ); } return context; }
private Map getContextForLongestPathPrefix( String url ) { Map context = _urlTree; ParsedPath path = new ParsedPath( url ); while (path.hasNext()) { String part = path.next(); if (!context.containsKey( part )) break; context = (Map) context.get( part ); } return context; }
private Map getContextForLongestPathPrefix( String url ) { Map context = _urlTree; ParsedPath path = new ParsedPath( url ); while (path.hasNext()) { String part = path.next(); if (!context.containsKey( part )) break; context = (Map) context.get( part ); } return context; }
void put( String mapping, WebResourceConfiguration configuration ) { if (mapping.equals( "/" )) { _defaultMapping = new WebResourceMapping( configuration ); } else if (mapping.startsWith( "*." )) { _extensions.put( mapping.substring( 2 ), new WebResourceMapping( configuration ) ); } else if (!mapping.startsWith( "/" ) || !mapping.endsWith( "/*" )) { _exactMatches.put( mapping, new WebResourceMapping( configuration ) ); } else { ParsedPath path = new ParsedPath( mapping ); Map context = _urlTree; while (path.hasNext()) { String part = path.next(); if (part.equals( "*" )) { context.put( "*", new PartialMatchWebResourceMapping( configuration, mapping ) ); return; } if (!context.containsKey( part )) { context.put( part, new HashMap() ); } context = (Map) context.get( part ); } } }
void put( String mapping, WebResourceConfiguration configuration ) { if (mapping.equals( "/" )) { _defaultMapping = new WebResourceMapping( configuration ); } else if (mapping.startsWith( "*." )) { _extensions.put( mapping.substring( 2 ), new WebResourceMapping( configuration ) ); } else if (!mapping.startsWith( "/" ) || !mapping.endsWith( "/*" )) { _exactMatches.put( mapping, new WebResourceMapping( configuration ) ); } else { ParsedPath path = new ParsedPath( mapping ); Map context = _urlTree; while (path.hasNext()) { String part = path.next(); if (part.equals( "*" )) { context.put( "*", new PartialMatchWebResourceMapping( configuration, mapping ) ); return; } if (!context.containsKey( part )) { context.put( part, new HashMap() ); } context = (Map) context.get( part ); } } }
void put( String mapping, WebResourceConfiguration configuration ) { if (mapping.equals( "/" )) { _defaultMapping = new WebResourceMapping( configuration ); } else if (mapping.startsWith( "*." )) { _extensions.put( mapping.substring( 2 ), new WebResourceMapping( configuration ) ); } else if (!mapping.startsWith( "/" ) || !mapping.endsWith( "/*" )) { _exactMatches.put( mapping, new WebResourceMapping( configuration ) ); } else { ParsedPath path = new ParsedPath( mapping ); Map context = _urlTree; while (path.hasNext()) { String part = path.next(); if (part.equals( "*" )) { context.put( "*", new PartialMatchWebResourceMapping( configuration, mapping ) ); return; } if (!context.containsKey( part )) { context.put( part, new HashMap() ); } context = (Map) context.get( part ); } } }