APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.net.httpserver

pack-priv Class ContextList

extends Object
Class Inheritance
Imports
java.util.*, java.util.function.BiPredicate

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private final LinkedList<HttpContextImpl>
private static final System.Logger

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public synchronized void
pack-priv boolean
pack-priv HttpContextImpl

Returns:

the context with the longest case-sensitive prefix match
findContext
(String
the request protocol
protocol
,
String
the request path
path
)

Returns the context with the longest case-sensitive prefix match.

private synchronized HttpContextImpl
public synchronized void
remove(String protocol, String path)

public synchronized void
public synchronized int
size()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listback to summary
private final LinkedList<HttpContextImpl> list
LOGGERback to summary
private static final System.Logger LOGGER

Constructor Detail

ContextListback to summary
pack-priv ContextList()

Method Detail

addback to summary
public synchronized void add(HttpContextImpl ctx)
containsback to summary
pack-priv boolean contains(HttpContextImpl ctx)
findContextback to summary
pack-priv HttpContextImpl findContext(String protocol, String path)

Returns the context with the longest case-sensitive prefix match.

Parameters
protocol:String

the request protocol

path:String

the request path

Returns:HttpContextImpl

the context with the longest case-sensitive prefix match

findContextback to summary
private synchronized HttpContextImpl findContext(String protocol, String path, ContextList.ContextPathMatcher matcher)
removeback to summary
public synchronized void remove(String protocol, String path) throws IllegalArgumentException
removeback to summary
public synchronized void remove(HttpContextImpl context) throws IllegalArgumentException
sizeback to summary
public synchronized int size()
sun.net.httpserver back to summary

private final Enum ContextList.ContextPathMatcher

extends Enum<ContextList.ContextPathMatcher>
implements BiPredicate<String, String>
Class Inheritance
All Implemented Interfaces
java.util.function.BiPredicate

Field Summary

Modifier and TypeField and Description
public static final ContextList.ContextPathMatcher
EXACT

Tests if both the request path and the context path are identical.

public static final ContextList.ContextPathMatcher
PATH_PREFIX

Tests path prefix matches where path segments must have an exact match.

private final BiPredicate<String, String>
public static final ContextList.ContextPathMatcher
STRING_PREFIX

Tests string prefix matches where the request path string starts with the context path string.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static ContextList.ContextPathMatcher
public boolean
test(String contextPath, String requestPath)

Implements java.util.function.BiPredicate.test.

Evaluates this predicate on the given arguments.

public static ContextList.ContextPathMatcher
public static ContextList.ContextPathMatcher[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

EXACTback to summary
public static final ContextList.ContextPathMatcher EXACT

Tests if both the request path and the context path are identical.

PATH_PREFIXback to summary
public static final ContextList.ContextPathMatcher PATH_PREFIX

Tests path prefix matches where path segments must have an exact match.

Examples

Context path Request path
/foo /foo/ /foo/bar /foobar
/ Y Y Y Y
/foo Y Y Y N
/foo/ N Y Y N
predicateback to summary
private final BiPredicate<String, String> predicate
STRING_PREFIXback to summary
public static final ContextList.ContextPathMatcher STRING_PREFIX

Tests string prefix matches where the request path string starts with the context path string.

Examples

Context path Request path
/foo /foo/ /foo/bar /foobar
/ Y Y Y Y
/foo Y Y Y Y
/foo/ N Y Y N

Constructor Detail

ContextPathMatcherback to summary
private ContextPathMatcher(BiPredicate<String, String> predicate)

Method Detail

ofConfiguredPrefixPathMatcherback to summary
private static ContextList.ContextPathMatcher ofConfiguredPrefixPathMatcher()
testback to summary
public boolean test(String contextPath, String requestPath)

Implements java.util.function.BiPredicate.test.

Doc from java.util.function.BiPredicate.test.

Evaluates this predicate on the given arguments.

Annotations
@Override
valueOfback to summary
public static ContextList.ContextPathMatcher valueOf(String name)
valuesback to summary
public static ContextList.ContextPathMatcher[] values()