repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Holder.java | Holder.get | public synchronized Object get(Object name)
{
if (_initParams==null)
return null;
return _initParams.get(name);
} | java | public synchronized Object get(Object name)
{
if (_initParams==null)
return null;
return _initParams.get(name);
} | [
"public",
"synchronized",
"Object",
"get",
"(",
"Object",
"name",
")",
"{",
"if",
"(",
"_initParams",
"==",
"null",
")",
"return",
"null",
";",
"return",
"_initParams",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Map get method.
FilterHolder implements the Map interface as a
configuration conveniance. The methods are mapped to the
filter properties. | [
"Map",
"get",
"method",
".",
"FilterHolder",
"implements",
"the",
"Map",
"interface",
"as",
"a",
"configuration",
"conveniance",
".",
"The",
"methods",
"are",
"mapped",
"to",
"the",
"filter",
"properties",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Holder.java#L172-L177 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.getFieldNames | public Enumeration getFieldNames()
{
return new Enumeration()
{
int i=0;
Field field=null;
public boolean hasMoreElements()
{
if (field!=null)
return true;
while (i<_f... | java | public Enumeration getFieldNames()
{
return new Enumeration()
{
int i=0;
Field field=null;
public boolean hasMoreElements()
{
if (field!=null)
return true;
while (i<_f... | [
"public",
"Enumeration",
"getFieldNames",
"(",
")",
"{",
"return",
"new",
"Enumeration",
"(",
")",
"{",
"int",
"i",
"=",
"0",
";",
"Field",
"field",
"=",
"null",
";",
"public",
"boolean",
"hasMoreElements",
"(",
")",
"{",
"if",
"(",
"field",
"!=",
"nul... | Get enumeration of header _names.
Returns an enumeration of strings representing the header _names
for this request. | [
"Get",
"enumeration",
"of",
"header",
"_names",
".",
"Returns",
"an",
"enumeration",
"of",
"strings",
"representing",
"the",
"header",
"_names",
"for",
"this",
"request",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L637-L672 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.getIntField | public int getIntField(String name)
throws NumberFormatException
{
String val = valueParameters(get(name),null);
if (val!=null)
return Integer.parseInt(val);
return -1;
} | java | public int getIntField(String name)
throws NumberFormatException
{
String val = valueParameters(get(name),null);
if (val!=null)
return Integer.parseInt(val);
return -1;
} | [
"public",
"int",
"getIntField",
"(",
"String",
"name",
")",
"throws",
"NumberFormatException",
"{",
"String",
"val",
"=",
"valueParameters",
"(",
"get",
"(",
"name",
")",
",",
"null",
")",
";",
"if",
"(",
"val",
"!=",
"null",
")",
"return",
"Integer",
".... | Get a header as an integer value.
Returns the value of an integer field or -1 if not found.
The case of the field name is ignored.
@param name the case-insensitive field name
@exception NumberFormatException If bad integer found | [
"Get",
"a",
"header",
"as",
"an",
"integer",
"value",
".",
"Returns",
"the",
"value",
"of",
"an",
"integer",
"field",
"or",
"-",
"1",
"if",
"not",
"found",
".",
"The",
"case",
"of",
"the",
"field",
"name",
"is",
"ignored",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L959-L966 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.addDateField | public void addDateField(String name, long date)
{
if (_dateBuffer==null)
{
_dateBuffer=new StringBuffer(32);
_calendar=new HttpCal();
}
_dateBuffer.setLength(0);
_calendar.setTimeInMillis(date);
formatDate(_dateBuffer, _calendar, false);
... | java | public void addDateField(String name, long date)
{
if (_dateBuffer==null)
{
_dateBuffer=new StringBuffer(32);
_calendar=new HttpCal();
}
_dateBuffer.setLength(0);
_calendar.setTimeInMillis(date);
formatDate(_dateBuffer, _calendar, false);
... | [
"public",
"void",
"addDateField",
"(",
"String",
"name",
",",
"long",
"date",
")",
"{",
"if",
"(",
"_dateBuffer",
"==",
"null",
")",
"{",
"_dateBuffer",
"=",
"new",
"StringBuffer",
"(",
"32",
")",
";",
"_calendar",
"=",
"new",
"HttpCal",
"(",
")",
";",... | Adds the value of a date field.
@param name the field name
@param date the field date value | [
"Adds",
"the",
"value",
"of",
"a",
"date",
"field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L1063-L1074 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.clear | public void clear()
{
_version++;
if (_version>1000)
{
_version=0;
for (int i=_fields.size();i-->0;)
{
Field field=(Field)_fields.get(i);
if (field!=null)
field.clear();
}
}
} | java | public void clear()
{
_version++;
if (_version>1000)
{
_version=0;
for (int i=_fields.size();i-->0;)
{
Field field=(Field)_fields.get(i);
if (field!=null)
field.clear();
}
}
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"_version",
"++",
";",
"if",
"(",
"_version",
">",
"1000",
")",
"{",
"_version",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"_fields",
".",
"size",
"(",
")",
";",
"i",
"--",
">",
"0",
";",
")",
"{",
... | Clear the header. | [
"Clear",
"the",
"header",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L1255-L1268 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.destroy | public void destroy()
{
for (int i=_fields.size();i-->0;)
{
Field field=(Field)_fields.get(i);
if (field!=null)
field.destroy();
}
_fields=null;
_index=null;
_dateBuffer=null;
_calendar=null;
_dateReceive=null... | java | public void destroy()
{
for (int i=_fields.size();i-->0;)
{
Field field=(Field)_fields.get(i);
if (field!=null)
field.destroy();
}
_fields=null;
_index=null;
_dateBuffer=null;
_calendar=null;
_dateReceive=null... | [
"public",
"void",
"destroy",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"_fields",
".",
"size",
"(",
")",
";",
"i",
"--",
">",
"0",
";",
")",
"{",
"Field",
"field",
"=",
"(",
"Field",
")",
"_fields",
".",
"get",
"(",
"i",
")",
";",
"if",
"... | Destroy the header.
Help the garbage collector by null everything that we can. | [
"Destroy",
"the",
"header",
".",
"Help",
"the",
"garbage",
"collector",
"by",
"null",
"everything",
"that",
"we",
"can",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L1274-L1287 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.addSetCookie | public void addSetCookie(Cookie cookie)
{
String name=cookie.getName();
String value=cookie.getValue();
int version=cookie.getVersion();
// Check arguments
if (name==null || name.length()==0)
throw new IllegalArgumentException("Bad cookie name");
... | java | public void addSetCookie(Cookie cookie)
{
String name=cookie.getName();
String value=cookie.getValue();
int version=cookie.getVersion();
// Check arguments
if (name==null || name.length()==0)
throw new IllegalArgumentException("Bad cookie name");
... | [
"public",
"void",
"addSetCookie",
"(",
"Cookie",
"cookie",
")",
"{",
"String",
"name",
"=",
"cookie",
".",
"getName",
"(",
")",
";",
"String",
"value",
"=",
"cookie",
".",
"getValue",
"(",
")",
";",
"int",
"version",
"=",
"cookie",
".",
"getVersion",
"... | Format a set cookie value
@param cookie The cookie. | [
"Format",
"a",
"set",
"cookie",
"value"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L1421-L1501 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java | HttpFields.add | public void add(HttpFields fields)
{
if (fields==null)
return;
Enumeration enm = fields.getFieldNames();
while( enm.hasMoreElements() )
{
String name = (String)enm.nextElement();
Enumeration values = fields.getValues(name);
while(value... | java | public void add(HttpFields fields)
{
if (fields==null)
return;
Enumeration enm = fields.getFieldNames();
while( enm.hasMoreElements() )
{
String name = (String)enm.nextElement();
Enumeration values = fields.getValues(name);
while(value... | [
"public",
"void",
"add",
"(",
"HttpFields",
"fields",
")",
"{",
"if",
"(",
"fields",
"==",
"null",
")",
"return",
";",
"Enumeration",
"enm",
"=",
"fields",
".",
"getFieldNames",
"(",
")",
";",
"while",
"(",
"enm",
".",
"hasMoreElements",
"(",
")",
")",... | Add fields from another HttpFields instance.
Single valued fields are replaced, while all others are added.
@param fields | [
"Add",
"fields",
"from",
"another",
"HttpFields",
"instance",
".",
"Single",
"valued",
"fields",
"are",
"replaced",
"while",
"all",
"others",
"are",
"added",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpFields.java#L1508-L1521 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java | HttpResponse.readHeader | public void readHeader(HttpInputStream in)
throws IOException
{
_state=__MSG_BAD;
log.warn(LogSupport.NOT_IMPLEMENTED);
} | java | public void readHeader(HttpInputStream in)
throws IOException
{
_state=__MSG_BAD;
log.warn(LogSupport.NOT_IMPLEMENTED);
} | [
"public",
"void",
"readHeader",
"(",
"HttpInputStream",
"in",
")",
"throws",
"IOException",
"{",
"_state",
"=",
"__MSG_BAD",
";",
"log",
".",
"warn",
"(",
"LogSupport",
".",
"NOT_IMPLEMENTED",
")",
";",
"}"
] | Not Implemented.
@param in
@exception IOException | [
"Not",
"Implemented",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java#L253-L258 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java | HttpResponse.sendError | public void sendError(int code,String message)
throws IOException
{
setStatus(code,message);
// Generate normal error page.
HttpRequest request=getHttpRequest();
// If we are allowed to have a body
if (code!=__204_No_Content &&
... | java | public void sendError(int code,String message)
throws IOException
{
setStatus(code,message);
// Generate normal error page.
HttpRequest request=getHttpRequest();
// If we are allowed to have a body
if (code!=__204_No_Content &&
... | [
"public",
"void",
"sendError",
"(",
"int",
"code",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"setStatus",
"(",
"code",
",",
"message",
")",
";",
"// Generate normal error page.",
"HttpRequest",
"request",
"=",
"getHttpRequest",
"(",
")",
";",
... | Send Error Response. | [
"Send",
"Error",
"Response",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java#L337-L368 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java | HttpResponse.addSetCookie | public void addSetCookie(String name,
String value)
{
_header.addSetCookie(new Cookie(name,value));
} | java | public void addSetCookie(String name,
String value)
{
_header.addSetCookie(new Cookie(name,value));
} | [
"public",
"void",
"addSetCookie",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"_header",
".",
"addSetCookie",
"(",
"new",
"Cookie",
"(",
"name",
",",
"value",
")",
")",
";",
"}"
] | Add a Set-Cookie field. | [
"Add",
"a",
"Set",
"-",
"Cookie",
"field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java#L405-L409 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java | HttpResponse.recycle | void recycle(HttpConnection connection)
{
super.recycle(connection);
_status=__200_OK;
_reason=null;
_httpContext=null;
} | java | void recycle(HttpConnection connection)
{
super.recycle(connection);
_status=__200_OK;
_reason=null;
_httpContext=null;
} | [
"void",
"recycle",
"(",
"HttpConnection",
"connection",
")",
"{",
"super",
".",
"recycle",
"(",
"connection",
")",
";",
"_status",
"=",
"__200_OK",
";",
"_reason",
"=",
"null",
";",
"_httpContext",
"=",
"null",
";",
"}"
] | Recycle the response. | [
"Recycle",
"the",
"response",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpResponse.java#L441-L447 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/Server.java | Server.configure | public void configure(String configuration)
throws IOException
{
URL url=Resource.newResource(configuration).getURL();
if (_configuration!=null && _configuration.equals(url.toString()))
return;
if (_configuration!=null)
throw new IllegalStateException("Alread... | java | public void configure(String configuration)
throws IOException
{
URL url=Resource.newResource(configuration).getURL();
if (_configuration!=null && _configuration.equals(url.toString()))
return;
if (_configuration!=null)
throw new IllegalStateException("Alread... | [
"public",
"void",
"configure",
"(",
"String",
"configuration",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"Resource",
".",
"newResource",
"(",
"configuration",
")",
".",
"getURL",
"(",
")",
";",
"if",
"(",
"_configuration",
"!=",
"null",
"&&",
"... | Configure the server from an XML file.
@param configuration The filename or URL of the XML
configuration file. | [
"Configure",
"the",
"server",
"from",
"an",
"XML",
"file",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L166-L190 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/Server.java | Server.setWebApplicationConfigurationClassNames | public void setWebApplicationConfigurationClassNames (String[] configurationClassNames)
{
if (configurationClassNames != null)
{
_webAppConfigurationClassNames = new String[configurationClassNames.length];
System.arraycopy(configurationClassNames, 0, _webAppConfigurationClass... | java | public void setWebApplicationConfigurationClassNames (String[] configurationClassNames)
{
if (configurationClassNames != null)
{
_webAppConfigurationClassNames = new String[configurationClassNames.length];
System.arraycopy(configurationClassNames, 0, _webAppConfigurationClass... | [
"public",
"void",
"setWebApplicationConfigurationClassNames",
"(",
"String",
"[",
"]",
"configurationClassNames",
")",
"{",
"if",
"(",
"configurationClassNames",
"!=",
"null",
")",
"{",
"_webAppConfigurationClassNames",
"=",
"new",
"String",
"[",
"configurationClassNames"... | setWebApplicationConfigurationClasses
Set up the list of classnames of WebApplicationContext.Configuration
implementations that will be applied to configure every webapp.
The list can be overridden by individual WebApplicationContexts.
@param configurationClasses | [
"setWebApplicationConfigurationClasses",
"Set",
"up",
"the",
"list",
"of",
"classnames",
"of",
"WebApplicationContext",
".",
"Configuration",
"implementations",
"that",
"will",
"be",
"applied",
"to",
"configure",
"every",
"webapp",
".",
"The",
"list",
"can",
"be",
"... | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/Server.java#L424-L431 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addText | public void addText(String label,
String value)
{
Composite c = new Composite();
c.add(value);
addField(label,c);
} | java | public void addText(String label,
String value)
{
Composite c = new Composite();
c.add(value);
addField(label,c);
} | [
"public",
"void",
"addText",
"(",
"String",
"label",
",",
"String",
"value",
")",
"{",
"Composite",
"c",
"=",
"new",
"Composite",
"(",
")",
";",
"c",
".",
"add",
"(",
"value",
")",
";",
"addField",
"(",
"label",
",",
"c",
")",
";",
"}"
] | Add an informational section. | [
"Add",
"an",
"informational",
"section",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L55-L61 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addTextField | public Input addTextField(String tag,
String label,
int length,
String value)
{
Input i = new Input(Input.Text,tag,value);
i.setSize(length);
addField(label,i);
return i;
} | java | public Input addTextField(String tag,
String label,
int length,
String value)
{
Input i = new Input(Input.Text,tag,value);
i.setSize(length);
addField(label,i);
return i;
} | [
"public",
"Input",
"addTextField",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"int",
"length",
",",
"String",
"value",
")",
"{",
"Input",
"i",
"=",
"new",
"Input",
"(",
"Input",
".",
"Text",
",",
"tag",
",",
"value",
")",
";",
"i",
".",
"se... | Add a Text Entry Field.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"Text",
"Entry",
"Field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L68-L77 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addTextArea | public TextArea addTextArea(String tag,
String label,
int width,
int height,
String value)
{
TextArea ta = new TextArea(tag,value);
ta.setSize(width,height);
addFi... | java | public TextArea addTextArea(String tag,
String label,
int width,
int height,
String value)
{
TextArea ta = new TextArea(tag,value);
ta.setSize(width,height);
addFi... | [
"public",
"TextArea",
"addTextArea",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"int",
"width",
",",
"int",
"height",
",",
"String",
"value",
")",
"{",
"TextArea",
"ta",
"=",
"new",
"TextArea",
"(",
"tag",
",",
"value",
")",
";",
"ta",
".",
"... | Add a Text Area.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"Text",
"Area",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L84-L94 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addFileField | public Input addFileField(String tag,
String label)
{
Input i = new Input(Input.File,tag);
addField(label,i);
return i;
} | java | public Input addFileField(String tag,
String label)
{
Input i = new Input(Input.File,tag);
addField(label,i);
return i;
} | [
"public",
"Input",
"addFileField",
"(",
"String",
"tag",
",",
"String",
"label",
")",
"{",
"Input",
"i",
"=",
"new",
"Input",
"(",
"Input",
".",
"File",
",",
"tag",
")",
";",
"addField",
"(",
"label",
",",
"i",
")",
";",
"return",
"i",
";",
"}"
] | Add a File Entry Field.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"File",
"Entry",
"Field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L101-L107 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addInfoField | public void addInfoField(String tag,
String label,
String value)
{
addText(label,value);
addHiddenField(tag,value);
} | java | public void addInfoField(String tag,
String label,
String value)
{
addText(label,value);
addHiddenField(tag,value);
} | [
"public",
"void",
"addInfoField",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"String",
"value",
")",
"{",
"addText",
"(",
"label",
",",
"value",
")",
";",
"addHiddenField",
"(",
"tag",
",",
"value",
")",
";",
"}"
] | Add an informational field which also passes the data as hidden.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"an",
"informational",
"field",
"which",
"also",
"passes",
"the",
"data",
"as",
"hidden",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L114-L120 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addHiddenField | public void addHiddenField(String tag,
String value)
{
Element e = new Input(Input.Hidden,tag,value);
hidden.add(e);
} | java | public void addHiddenField(String tag,
String value)
{
Element e = new Input(Input.Hidden,tag,value);
hidden.add(e);
} | [
"public",
"void",
"addHiddenField",
"(",
"String",
"tag",
",",
"String",
"value",
")",
"{",
"Element",
"e",
"=",
"new",
"Input",
"(",
"Input",
".",
"Hidden",
",",
"tag",
",",
"value",
")",
";",
"hidden",
".",
"add",
"(",
"e",
")",
";",
"}"
] | Add a hidden field.
@param tag The form name of the element | [
"Add",
"a",
"hidden",
"field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L126-L131 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addPassword | public void addPassword(String tag,
String label,
int length)
{
Input i = new Input(Input.Password,tag);
i.setSize(length);
addField(label,i);
} | java | public void addPassword(String tag,
String label,
int length)
{
Input i = new Input(Input.Password,tag);
i.setSize(length);
addField(label,i);
} | [
"public",
"void",
"addPassword",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"int",
"length",
")",
"{",
"Input",
"i",
"=",
"new",
"Input",
"(",
"Input",
".",
"Password",
",",
"tag",
")",
";",
"i",
".",
"setSize",
"(",
"length",
")",
";",
"ad... | Add a password field.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"password",
"field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L138-L145 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addSelect | public Select addSelect(String tag,
String label,
boolean multiple,
int size)
{
Select s = new Select(tag,multiple);
s.setSize(size);
addField(label,s);
return s;
} | java | public Select addSelect(String tag,
String label,
boolean multiple,
int size)
{
Select s = new Select(tag,multiple);
s.setSize(size);
addField(label,s);
return s;
} | [
"public",
"Select",
"addSelect",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"boolean",
"multiple",
",",
"int",
"size",
")",
"{",
"Select",
"s",
"=",
"new",
"Select",
"(",
"tag",
",",
"multiple",
")",
";",
"s",
".",
"setSize",
"(",
"size",
")"... | Add a Select field.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"Select",
"field",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L167-L176 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addSelect | public Select addSelect(String tag,
String label,
boolean multiple,
int size,
Enumeration values)
{
Select s = addSelect(tag,label,multiple,size);
s.setSize(size);
while (values.ha... | java | public Select addSelect(String tag,
String label,
boolean multiple,
int size,
Enumeration values)
{
Select s = addSelect(tag,label,multiple,size);
s.setSize(size);
while (values.ha... | [
"public",
"Select",
"addSelect",
"(",
"String",
"tag",
",",
"String",
"label",
",",
"boolean",
"multiple",
",",
"int",
"size",
",",
"Enumeration",
"values",
")",
"{",
"Select",
"s",
"=",
"addSelect",
"(",
"tag",
",",
"label",
",",
"multiple",
",",
"size"... | Add a Select field initialised with fields.
@param tag The form name of the element
@param label The label for the element in the table. | [
"Add",
"a",
"Select",
"field",
"initialised",
"with",
"fields",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L183-L194 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addButton | public Input addButton(String tag,
String label)
{
if (buttons==null)
buttonsAtBottom();
Input e = new Input(Input.Submit,tag,label);
if (extendRow)
addField(null,e);
else
buttons.add(e);
return e;
} | java | public Input addButton(String tag,
String label)
{
if (buttons==null)
buttonsAtBottom();
Input e = new Input(Input.Submit,tag,label);
if (extendRow)
addField(null,e);
else
buttons.add(e);
return e;
} | [
"public",
"Input",
"addButton",
"(",
"String",
"tag",
",",
"String",
"label",
")",
"{",
"if",
"(",
"buttons",
"==",
"null",
")",
"buttonsAtBottom",
"(",
")",
";",
"Input",
"e",
"=",
"new",
"Input",
"(",
"Input",
".",
"Submit",
",",
"tag",
",",
"label... | Add a Submit Button.
@param tag The form name of the element
@param label The label for the Button | [
"Add",
"a",
"Submit",
"Button",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L263-L275 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addReset | public void addReset(String label)
{
if (buttons==null)
buttonsAtBottom();
Element e = new Input(Input.Reset,"Reset",label);
if (extendRow)
addField(null,e);
else
buttons.add(e);
} | java | public void addReset(String label)
{
if (buttons==null)
buttonsAtBottom();
Element e = new Input(Input.Reset,"Reset",label);
if (extendRow)
addField(null,e);
else
buttons.add(e);
} | [
"public",
"void",
"addReset",
"(",
"String",
"label",
")",
"{",
"if",
"(",
"buttons",
"==",
"null",
")",
"buttonsAtBottom",
"(",
")",
";",
"Element",
"e",
"=",
"new",
"Input",
"(",
"Input",
".",
"Reset",
",",
"\"Reset\"",
",",
"label",
")",
";",
"if"... | Add a reset button.
@param label The label for the element in the table. | [
"Add",
"a",
"reset",
"button",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L281-L290 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addField | public void addField(String label,Element field)
{
if (label==null)
label=" ";
else
label="<b>"+label+":</b>";
if (extendRow)
{
column.add(field);
extendRow=false;
}
else
{
column.newRow();
... | java | public void addField(String label,Element field)
{
if (label==null)
label=" ";
else
label="<b>"+label+":</b>";
if (extendRow)
{
column.add(field);
extendRow=false;
}
else
{
column.newRow();
... | [
"public",
"void",
"addField",
"(",
"String",
"label",
",",
"Element",
"field",
")",
"{",
"if",
"(",
"label",
"==",
"null",
")",
"label",
"=",
"\" \"",
";",
"else",
"label",
"=",
"\"<b>\"",
"+",
"label",
"+",
"\":</b>\"",
";",
"if",
"(",
"extendRow... | Add an arbitrary element to the table.
@param label The label for the element in the table. | [
"Add",
"an",
"arbitrary",
"element",
"to",
"the",
"table",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L327-L353 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.addColumn | public void addColumn(int spacing)
{
table.addCell(" ","width="+spacing);
column = new Table(0);
table.addCell(column);
table.cell().top();
columns++;
} | java | public void addColumn(int spacing)
{
table.addCell(" ","width="+spacing);
column = new Table(0);
table.addCell(column);
table.cell().top();
columns++;
} | [
"public",
"void",
"addColumn",
"(",
"int",
"spacing",
")",
"{",
"table",
".",
"addCell",
"(",
"\" \"",
",",
"\"width=\"",
"+",
"spacing",
")",
";",
"column",
"=",
"new",
"Table",
"(",
"0",
")",
";",
"table",
".",
"addCell",
"(",
"column",
")",
";... | Create a new column in the form. | [
"Create",
"a",
"new",
"column",
"in",
"the",
"form",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L368-L375 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.newColumns | public void newColumns()
{
column = new Table(0);
columns = 1;
table.newRow();
table.addCell(column);
table.cell().top();
} | java | public void newColumns()
{
column = new Table(0);
columns = 1;
table.newRow();
table.addCell(column);
table.cell().top();
} | [
"public",
"void",
"newColumns",
"(",
")",
"{",
"column",
"=",
"new",
"Table",
"(",
"0",
")",
";",
"columns",
"=",
"1",
";",
"table",
".",
"newRow",
"(",
")",
";",
"table",
".",
"addCell",
"(",
"column",
")",
";",
"table",
".",
"cell",
"(",
")",
... | Add a new sections of columns. | [
"Add",
"a",
"new",
"sections",
"of",
"columns",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L380-L387 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/TableForm.java | TableForm.newTable | public void newTable()
{
table = new Table(0);
column = new Table(0);
columns = 1;
super.add(table);
table.newRow();
table.addCell(column).top();
} | java | public void newTable()
{
table = new Table(0);
column = new Table(0);
columns = 1;
super.add(table);
table.newRow();
table.addCell(column).top();
} | [
"public",
"void",
"newTable",
"(",
")",
"{",
"table",
"=",
"new",
"Table",
"(",
"0",
")",
";",
"column",
"=",
"new",
"Table",
"(",
"0",
")",
";",
"columns",
"=",
"1",
";",
"super",
".",
"add",
"(",
"table",
")",
";",
"table",
".",
"newRow",
"("... | Start using a new Table.
Anything added to the Composite parent of
this object before this is called will be added between the two
tables. | [
"Start",
"using",
"a",
"new",
"Table",
".",
"Anything",
"added",
"to",
"the",
"Composite",
"parent",
"of",
"this",
"object",
"before",
"this",
"is",
"called",
"will",
"be",
"added",
"between",
"the",
"two",
"tables",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/TableForm.java#L406-L414 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/http/SimulatedSocketFactory.java | SimulatedSocketFactory.isSecure | @Override
public final boolean isSecure(Socket sock)
throws IllegalArgumentException {
if (sock == null) {
throw new IllegalArgumentException("Socket may not be null.");
}
// This check is performed last since it calls a method implemented
// by the argument ... | java | @Override
public final boolean isSecure(Socket sock)
throws IllegalArgumentException {
if (sock == null) {
throw new IllegalArgumentException("Socket may not be null.");
}
// This check is performed last since it calls a method implemented
// by the argument ... | [
"@",
"Override",
"public",
"final",
"boolean",
"isSecure",
"(",
"Socket",
"sock",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"sock",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Socket may not be null.\"",
")",
";",
... | Checks whether a socket connection is secure. This factory creates plain socket connections which are not
considered secure.
@param sock the connected socket
@return <code>false</code>
@throws IllegalArgumentException if the argument is invalid | [
"Checks",
"whether",
"a",
"socket",
"connection",
"is",
"secure",
".",
"This",
"factory",
"creates",
"plain",
"socket",
"connections",
"which",
"are",
"not",
"considered",
"secure",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/http/SimulatedSocketFactory.java#L200-L213 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/URLResource.java | URLResource.release | public synchronized void release()
{
if (_in!=null)
{
try{_in.close();}catch(IOException e){LogSupport.ignore(log,e);}
_in=null;
}
if (_connection!=null)
_connection=null;
} | java | public synchronized void release()
{
if (_in!=null)
{
try{_in.close();}catch(IOException e){LogSupport.ignore(log,e);}
_in=null;
}
if (_connection!=null)
_connection=null;
} | [
"public",
"synchronized",
"void",
"release",
"(",
")",
"{",
"if",
"(",
"_in",
"!=",
"null",
")",
"{",
"try",
"{",
"_in",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"LogSupport",
".",
"ignore",
"(",
"log",
",",
"... | Release any resources held by the resource. | [
"Release",
"any",
"resources",
"held",
"by",
"the",
"resource",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L72-L82 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/URLResource.java | URLResource.exists | public boolean exists()
{
try
{
synchronized(this)
{
if (checkConnection() && _in==null )
_in = _connection.getInputStream();
}
}
catch (IOException e)
{
LogSupport.ignore(log,e);
}
... | java | public boolean exists()
{
try
{
synchronized(this)
{
if (checkConnection() && _in==null )
_in = _connection.getInputStream();
}
}
catch (IOException e)
{
LogSupport.ignore(log,e);
}
... | [
"public",
"boolean",
"exists",
"(",
")",
"{",
"try",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"checkConnection",
"(",
")",
"&&",
"_in",
"==",
"null",
")",
"_in",
"=",
"_connection",
".",
"getInputStream",
"(",
")",
";",
"}",
"}",
"catch... | Returns true if the respresened resource exists. | [
"Returns",
"true",
"if",
"the",
"respresened",
"resource",
"exists",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L88-L103 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/URLResource.java | URLResource.getFile | public File getFile()
throws IOException
{
// Try the permission hack
if (checkConnection())
{
Permission perm = _connection.getPermission();
if (perm instanceof java.io.FilePermission)
return new File(perm.getName());
}
// Try... | java | public File getFile()
throws IOException
{
// Try the permission hack
if (checkConnection())
{
Permission perm = _connection.getPermission();
if (perm instanceof java.io.FilePermission)
return new File(perm.getName());
}
// Try... | [
"public",
"File",
"getFile",
"(",
")",
"throws",
"IOException",
"{",
"// Try the permission hack",
"if",
"(",
"checkConnection",
"(",
")",
")",
"{",
"Permission",
"perm",
"=",
"_connection",
".",
"getPermission",
"(",
")",
";",
"if",
"(",
"perm",
"instanceof",... | Returns an File representing the given resource or NULL if this
is not possible. | [
"Returns",
"an",
"File",
"representing",
"the",
"given",
"resource",
"or",
"NULL",
"if",
"this",
"is",
"not",
"possible",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L154-L171 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/URLResource.java | URLResource.getInputStream | public synchronized InputStream getInputStream()
throws java.io.IOException
{
if (!checkConnection())
throw new IOException( "Invalid resource");
try
{
if( _in != null)
{
InputStream in = _in;
_in=null;
... | java | public synchronized InputStream getInputStream()
throws java.io.IOException
{
if (!checkConnection())
throw new IOException( "Invalid resource");
try
{
if( _in != null)
{
InputStream in = _in;
_in=null;
... | [
"public",
"synchronized",
"InputStream",
"getInputStream",
"(",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"if",
"(",
"!",
"checkConnection",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"Invalid resource\"",
")",
";",
"try",
"{",
"if... | Returns an input stream to the resource | [
"Returns",
"an",
"input",
"stream",
"to",
"the",
"resource"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L186-L206 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/URLResource.java | URLResource.addPath | public Resource addPath(String path)
throws IOException,MalformedURLException
{
if (path==null)
return null;
path = URI.canonicalPath(path);
return newResource(URI.addPaths(_url.toExternalForm(),path));
} | java | public Resource addPath(String path)
throws IOException,MalformedURLException
{
if (path==null)
return null;
path = URI.canonicalPath(path);
return newResource(URI.addPaths(_url.toExternalForm(),path));
} | [
"public",
"Resource",
"addPath",
"(",
"String",
"path",
")",
"throws",
"IOException",
",",
"MalformedURLException",
"{",
"if",
"(",
"path",
"==",
"null",
")",
"return",
"null",
";",
"path",
"=",
"URI",
".",
"canonicalPath",
"(",
"path",
")",
";",
"return",... | Returns the resource contained inside the current resource with the
given name | [
"Returns",
"the",
"resource",
"contained",
"inside",
"the",
"current",
"resource",
"with",
"the",
"given",
"name"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L253-L262 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java | ServletHttpContext.getServletHandler | public synchronized ServletHandler getServletHandler()
{
if (_servletHandler==null)
_servletHandler=(ServletHandler) getHandler(ServletHandler.class);
if (_servletHandler==null)
{
_servletHandler=new ServletHandler();
addHandler(_servletHandler);
}... | java | public synchronized ServletHandler getServletHandler()
{
if (_servletHandler==null)
_servletHandler=(ServletHandler) getHandler(ServletHandler.class);
if (_servletHandler==null)
{
_servletHandler=new ServletHandler();
addHandler(_servletHandler);
}... | [
"public",
"synchronized",
"ServletHandler",
"getServletHandler",
"(",
")",
"{",
"if",
"(",
"_servletHandler",
"==",
"null",
")",
"_servletHandler",
"=",
"(",
"ServletHandler",
")",
"getHandler",
"(",
"ServletHandler",
".",
"class",
")",
";",
"if",
"(",
"_servlet... | Get the context ServletHandler.
Conveniance method. If no ServletHandler exists, a new one is added to
the context.
@return ServletHandler | [
"Get",
"the",
"context",
"ServletHandler",
".",
"Conveniance",
"method",
".",
"If",
"no",
"ServletHandler",
"exists",
"a",
"new",
"one",
"is",
"added",
"to",
"the",
"context",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L67-L77 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java | ServletHttpContext.addServlet | public synchronized ServletHolder addServlet(String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
return addServlet(className,pathSpec,className);
} | java | public synchronized ServletHolder addServlet(String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
return addServlet(className,pathSpec,className);
} | [
"public",
"synchronized",
"ServletHolder",
"addServlet",
"(",
"String",
"pathSpec",
",",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"return",
"addServlet",
"(",
"className",
",",
"pa... | Add a servlet to the context.
Conveniance method.
If no ServletHandler is found in the context, a new one is added.
@param pathSpec The pathspec within the context
@param className The classname of the servlet.
@return The ServletHolder.
@exception ClassNotFoundException
@exception InstantiationException
@exception Ill... | [
"Add",
"a",
"servlet",
"to",
"the",
"context",
".",
"Conveniance",
"method",
".",
"If",
"no",
"ServletHandler",
"is",
"found",
"in",
"the",
"context",
"a",
"new",
"one",
"is",
"added",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L90-L97 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java | ServletHttpContext.addServlet | public synchronized ServletHolder addServlet(String name,
String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
... | java | public synchronized ServletHolder addServlet(String name,
String pathSpec,
String className)
throws ClassNotFoundException,
InstantiationException,
IllegalAccessException
{
... | [
"public",
"synchronized",
"ServletHolder",
"addServlet",
"(",
"String",
"name",
",",
"String",
"pathSpec",
",",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"return",
"getServletHandler"... | Add a servlet to the context.
If no ServletHandler is found in the context, a new one is added.
@param name The name of the servlet.
@param pathSpec The pathspec within the context
@param className The classname of the servlet.
@return The ServletHolder.
@exception ClassNotFoundException
@exception InstantiationExcepti... | [
"Add",
"a",
"servlet",
"to",
"the",
"context",
".",
"If",
"no",
"ServletHandler",
"is",
"found",
"in",
"the",
"context",
"a",
"new",
"one",
"is",
"added",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L110-L118 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java | ServletHttpContext.getLocaleEncoding | public String getLocaleEncoding(Locale locale)
{
String encoding = (String)_localeEncodingMap.get(locale.toString());
if (encoding==null)
encoding = (String)_localeEncodingMap.get(locale.getLanguage());
return encoding;
} | java | public String getLocaleEncoding(Locale locale)
{
String encoding = (String)_localeEncodingMap.get(locale.toString());
if (encoding==null)
encoding = (String)_localeEncodingMap.get(locale.getLanguage());
return encoding;
} | [
"public",
"String",
"getLocaleEncoding",
"(",
"Locale",
"locale",
")",
"{",
"String",
"encoding",
"=",
"(",
"String",
")",
"_localeEncodingMap",
".",
"get",
"(",
"locale",
".",
"toString",
"(",
")",
")",
";",
"if",
"(",
"encoding",
"==",
"null",
")",
"en... | Get the character encoding for a locale. The full locale name is first
looked up in the map of encodings. If no encoding is found, then the
locale language is looked up.
@param locale a <code>Locale</code> value
@return a <code>String</code> representing the character encoding for
the locale or null if none found. | [
"Get",
"the",
"character",
"encoding",
"for",
"a",
"locale",
".",
"The",
"full",
"locale",
"name",
"is",
"first",
"looked",
"up",
"in",
"the",
"map",
"of",
"encodings",
".",
"If",
"no",
"encoding",
"is",
"found",
"then",
"the",
"locale",
"language",
"is"... | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L165-L171 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/StringMap.java | StringMap.getEntry | public Map.Entry getEntry(String key,int offset, int length)
{
if (key==null)
return _nullEntry;
Node node = _root;
int ni=-1;
// look for best match
charLoop:
for (int i=0;i<length;i++)
{
char c=key.charAt(offset+i);
... | java | public Map.Entry getEntry(String key,int offset, int length)
{
if (key==null)
return _nullEntry;
Node node = _root;
int ni=-1;
// look for best match
charLoop:
for (int i=0;i<length;i++)
{
char c=key.charAt(offset+i);
... | [
"public",
"Map",
".",
"Entry",
"getEntry",
"(",
"String",
"key",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"if",
"(",
"key",
"==",
"null",
")",
"return",
"_nullEntry",
";",
"Node",
"node",
"=",
"_root",
";",
"int",
"ni",
"=",
"-",
"1",
... | Get a map entry by substring key.
@param key String containing the key
@param offset Offset of the key within the String.
@param length The length of the key
@return The Map.Entry for the key or null if the key is not in
the map. | [
"Get",
"a",
"map",
"entry",
"by",
"substring",
"key",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringMap.java#L257-L303 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/selenium/LauncherUtils.java | LauncherUtils.recursivelyDeleteDir | public static void recursivelyDeleteDir(File customProfileDir) {
if (customProfileDir == null || !customProfileDir.exists()) {
return;
}
Delete delete = new Delete();
delete.setProject(new Project());
delete.setDir(customProfileDir);
delete.setFailOnError(true);
delete.execute();
} | java | public static void recursivelyDeleteDir(File customProfileDir) {
if (customProfileDir == null || !customProfileDir.exists()) {
return;
}
Delete delete = new Delete();
delete.setProject(new Project());
delete.setDir(customProfileDir);
delete.setFailOnError(true);
delete.execute();
} | [
"public",
"static",
"void",
"recursivelyDeleteDir",
"(",
"File",
"customProfileDir",
")",
"{",
"if",
"(",
"customProfileDir",
"==",
"null",
"||",
"!",
"customProfileDir",
".",
"exists",
"(",
")",
")",
"{",
"return",
";",
"}",
"Delete",
"delete",
"=",
"new",
... | Delete a directory and all subdirectories | [
"Delete",
"a",
"directory",
"and",
"all",
"subdirectories"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/LauncherUtils.java#L42-L51 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/BufferedOutputStream.java | BufferedOutputStream.flush | public void flush()
throws IOException
{
try
{
if (!_commited)
{
_commited=true;
if (_commitObserver!=null)
_commitObserver.outputNotify(this,OutputObserver.__COMMITING,null);
}
w... | java | public void flush()
throws IOException
{
try
{
if (!_commited)
{
_commited=true;
if (_commitObserver!=null)
_commitObserver.outputNotify(this,OutputObserver.__COMMITING,null);
}
w... | [
"public",
"void",
"flush",
"(",
")",
"throws",
"IOException",
"{",
"try",
"{",
"if",
"(",
"!",
"_commited",
")",
"{",
"_commited",
"=",
"true",
";",
"if",
"(",
"_commitObserver",
"!=",
"null",
")",
"_commitObserver",
".",
"outputNotify",
"(",
"this",
","... | This implementation calls the commitObserver on the first flush since
construction or reset. | [
"This",
"implementation",
"calls",
"the",
"commitObserver",
"on",
"the",
"first",
"flush",
"since",
"construction",
"or",
"reset",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/BufferedOutputStream.java#L183-L215 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java | LogImpl.reset | public synchronized void reset()
{
info("reset");
if (_sinks!=null) {
for (int s=_sinks.length;s-->0;)
{
try{
if (_sinks[s]!=null)
_sinks[s].stop();
_sinks[s]=null;
}
... | java | public synchronized void reset()
{
info("reset");
if (_sinks!=null) {
for (int s=_sinks.length;s-->0;)
{
try{
if (_sinks[s]!=null)
_sinks[s].stop();
_sinks[s]=null;
}
... | [
"public",
"synchronized",
"void",
"reset",
"(",
")",
"{",
"info",
"(",
"\"reset\"",
")",
";",
"if",
"(",
"_sinks",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"s",
"=",
"_sinks",
".",
"length",
";",
"s",
"--",
">",
"0",
";",
")",
"{",
"try",
"{"... | No logging.
All log sinks are stopped and removed. | [
"No",
"logging",
".",
"All",
"log",
"sinks",
"are",
"stopped",
"and",
"removed",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L227-L247 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java | LogImpl.message | public synchronized void message(String tag,
Object msg,
Frame frame,
long time)
{
if (!_initialized)
defaultInit();
boolean logged=false;
if (_sinks!=null)
... | java | public synchronized void message(String tag,
Object msg,
Frame frame,
long time)
{
if (!_initialized)
defaultInit();
boolean logged=false;
if (_sinks!=null)
... | [
"public",
"synchronized",
"void",
"message",
"(",
"String",
"tag",
",",
"Object",
"msg",
",",
"Frame",
"frame",
",",
"long",
"time",
")",
"{",
"if",
"(",
"!",
"_initialized",
")",
"defaultInit",
"(",
")",
";",
"boolean",
"logged",
"=",
"false",
";",
"i... | Log a message.
@param tag Tag for type of log
@param msg The message
@param frame The frame that generated the message.
@param time The time stamp of the message. | [
"Log",
"a",
"message",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L410-L436 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java | LogImpl.setDebug | public synchronized void setDebug(boolean debug)
{
boolean oldDebug=_debugOn;
if (_debugOn && !debug)
this.message(DEBUG,"DEBUG OFF");
_debugOn=debug;
if (!oldDebug && debug)
this.message(DEBUG,"DEBUG ON");
} | java | public synchronized void setDebug(boolean debug)
{
boolean oldDebug=_debugOn;
if (_debugOn && !debug)
this.message(DEBUG,"DEBUG OFF");
_debugOn=debug;
if (!oldDebug && debug)
this.message(DEBUG,"DEBUG ON");
} | [
"public",
"synchronized",
"void",
"setDebug",
"(",
"boolean",
"debug",
")",
"{",
"boolean",
"oldDebug",
"=",
"_debugOn",
";",
"if",
"(",
"_debugOn",
"&&",
"!",
"debug",
")",
"this",
".",
"message",
"(",
"DEBUG",
",",
"\"DEBUG OFF\"",
")",
";",
"_debugOn",
... | Set if debugging is on or off.
@param debug | [
"Set",
"if",
"debugging",
"is",
"on",
"or",
"off",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L465-L473 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java | LogImpl.setDebugPatterns | public void setDebugPatterns(String patterns)
{
_patterns=patterns;
if (patterns!=null && patterns.length()>0)
{
_debugPatterns = new ArrayList();
StringTokenizer tok = new StringTokenizer(patterns,", \t");
while (tok.hasMoreTokens())
{
... | java | public void setDebugPatterns(String patterns)
{
_patterns=patterns;
if (patterns!=null && patterns.length()>0)
{
_debugPatterns = new ArrayList();
StringTokenizer tok = new StringTokenizer(patterns,", \t");
while (tok.hasMoreTokens())
{
... | [
"public",
"void",
"setDebugPatterns",
"(",
"String",
"patterns",
")",
"{",
"_patterns",
"=",
"patterns",
";",
"if",
"(",
"patterns",
"!=",
"null",
"&&",
"patterns",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"_debugPatterns",
"=",
"new",
"ArrayList",
"... | Set debug patterns.
@param patterns comma separated string of patterns | [
"Set",
"debug",
"patterns",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L479-L495 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java | UrlEncoded.encode | public synchronized String encode(String charset, boolean equalsForNullValue)
{
if (charset==null)
charset=StringUtil.__ISO_8859_1;
StringBuffer result = new StringBuffer(128);
synchronized(result)
{
Iterator iter = entrySet().iterator();
... | java | public synchronized String encode(String charset, boolean equalsForNullValue)
{
if (charset==null)
charset=StringUtil.__ISO_8859_1;
StringBuffer result = new StringBuffer(128);
synchronized(result)
{
Iterator iter = entrySet().iterator();
... | [
"public",
"synchronized",
"String",
"encode",
"(",
"String",
"charset",
",",
"boolean",
"equalsForNullValue",
")",
"{",
"if",
"(",
"charset",
"==",
"null",
")",
"charset",
"=",
"StringUtil",
".",
"__ISO_8859_1",
";",
"StringBuffer",
"result",
"=",
"new",
"Stri... | Encode Hashtable with % encoding.
@param equalsForNullValue if True, then an '=' is always used, even
for parameters without a value. e.g. "blah?a=&b=&c=". | [
"Encode",
"Hashtable",
"with",
"%",
"encoding",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java#L104-L156 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java | UrlEncoded.decodeString | public static String decodeString(String encoded)
{
return decodeString(encoded,0,encoded.length(),StringUtil.__ISO_8859_1);
} | java | public static String decodeString(String encoded)
{
return decodeString(encoded,0,encoded.length(),StringUtil.__ISO_8859_1);
} | [
"public",
"static",
"String",
"decodeString",
"(",
"String",
"encoded",
")",
"{",
"return",
"decodeString",
"(",
"encoded",
",",
"0",
",",
"encoded",
".",
"length",
"(",
")",
",",
"StringUtil",
".",
"__ISO_8859_1",
")",
";",
"}"
] | Decode String with % encoding.
This method makes the assumption that the majority of calls
will need no decoding and uses the 8859 encoding. | [
"Decode",
"String",
"with",
"%",
"encoding",
".",
"This",
"method",
"makes",
"the",
"assumption",
"that",
"the",
"majority",
"of",
"calls",
"will",
"need",
"no",
"decoding",
"and",
"uses",
"the",
"8859",
"encoding",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java#L311-L314 | train |
webmetrics/browsermob-proxy | src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java | OnlineUpdateUASparser.checkDataMaps | @Override
protected synchronized void checkDataMaps() throws IOException {
if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) {
String versionOnServer = getVersionFromServer();
if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) {
loadDataFro... | java | @Override
protected synchronized void checkDataMaps() throws IOException {
if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) {
String versionOnServer = getVersionFromServer();
if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) {
loadDataFro... | [
"@",
"Override",
"protected",
"synchronized",
"void",
"checkDataMaps",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"lastUpdateCheck",
"==",
"0",
"||",
"lastUpdateCheck",
"<",
"System",
".",
"currentTimeMillis",
"(",
")",
"-",
"updateInterval",
")",
"{",
... | Since we've online access to the data file, we check every day for an update | [
"Since",
"we",
"ve",
"online",
"access",
"to",
"the",
"data",
"file",
"we",
"check",
"every",
"day",
"for",
"an",
"update"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L30-L40 | train |
webmetrics/browsermob-proxy | src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java | OnlineUpdateUASparser.loadDataFromInternet | private void loadDataFromInternet() throws IOException {
URL url = new URL(DATA_RETRIVE_URL);
InputStream is = url.openStream();
try {
PHPFileParser fp = new PHPFileParser(is);
createInternalDataStructre(fp.getSections());
} finally {
is.close();
}
} | java | private void loadDataFromInternet() throws IOException {
URL url = new URL(DATA_RETRIVE_URL);
InputStream is = url.openStream();
try {
PHPFileParser fp = new PHPFileParser(is);
createInternalDataStructre(fp.getSections());
} finally {
is.close();
}
} | [
"private",
"void",
"loadDataFromInternet",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"DATA_RETRIVE_URL",
")",
";",
"InputStream",
"is",
"=",
"url",
".",
"openStream",
"(",
")",
";",
"try",
"{",
"PHPFileParser",
"fp",
"="... | Loads the data file from user-agent-string.info
@throws IOException | [
"Loads",
"the",
"data",
"file",
"from",
"user",
"-",
"agent",
"-",
"string",
".",
"info"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L47-L56 | train |
webmetrics/browsermob-proxy | src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java | OnlineUpdateUASparser.getVersionFromServer | protected String getVersionFromServer() throws IOException {
URL url = new URL(VERSION_CHECK_URL);
InputStream is = url.openStream();
try {
byte[] buff = new byte[4048];
int len = is.read(buff);
return new String(buff, 0, len);
} finally {
is.close();
}
} | java | protected String getVersionFromServer() throws IOException {
URL url = new URL(VERSION_CHECK_URL);
InputStream is = url.openStream();
try {
byte[] buff = new byte[4048];
int len = is.read(buff);
return new String(buff, 0, len);
} finally {
is.close();
}
} | [
"protected",
"String",
"getVersionFromServer",
"(",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"VERSION_CHECK_URL",
")",
";",
"InputStream",
"is",
"=",
"url",
".",
"openStream",
"(",
")",
";",
"try",
"{",
"byte",
"[",
"]",
"... | Gets the current version from user-agent-string.info
@return
@throws IOException | [
"Gets",
"the",
"current",
"version",
"from",
"user",
"-",
"agent",
"-",
"string",
".",
"info"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L64-L74 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/LazyList.java | LazyList.add | public static Object add(Object list, Object item)
{
if (list==null)
{
if (item instanceof List || item==null)
{
List l = new ArrayList();
l.add(item);
return l;
}
return item;
}
if (lis... | java | public static Object add(Object list, Object item)
{
if (list==null)
{
if (item instanceof List || item==null)
{
List l = new ArrayList();
l.add(item);
return l;
}
return item;
}
if (lis... | [
"public",
"static",
"Object",
"add",
"(",
"Object",
"list",
",",
"Object",
"item",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"if",
"(",
"item",
"instanceof",
"List",
"||",
"item",
"==",
"null",
")",
"{",
"List",
"l",
"=",
"new",
"ArrayLi... | Add an item to a LazyList
@param list The list to add to or null if none yet created.
@param item The item to add.
@return The lazylist created or added to. | [
"Add",
"an",
"item",
"to",
"a",
"LazyList"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LazyList.java#L61-L85 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/LazyList.java | LazyList.add | protected Object add(Object list, Collection collection)
{
Iterator i=collection.iterator();
while(i.hasNext())
list=LazyList.add(list,i.next());
return list;
} | java | protected Object add(Object list, Collection collection)
{
Iterator i=collection.iterator();
while(i.hasNext())
list=LazyList.add(list,i.next());
return list;
} | [
"protected",
"Object",
"add",
"(",
"Object",
"list",
",",
"Collection",
"collection",
")",
"{",
"Iterator",
"i",
"=",
"collection",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"i",
".",
"hasNext",
"(",
")",
")",
"list",
"=",
"LazyList",
".",
"add",
... | Add the contents of a Collection to a LazyList
@param list The list to add to or null if none yet created.
@param collection The Collection whose contents should be added.
@return The lazylist created or added to.
@deprecated Use addCollection | [
"Add",
"the",
"contents",
"of",
"a",
"Collection",
"to",
"a",
"LazyList"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LazyList.java#L127-L133 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java | StringUtil.indexFrom | public static int indexFrom(String s,String chars)
{
for (int i=0;i<s.length();i++)
if (chars.indexOf(s.charAt(i))>=0)
return i;
return -1;
} | java | public static int indexFrom(String s,String chars)
{
for (int i=0;i<s.length();i++)
if (chars.indexOf(s.charAt(i))>=0)
return i;
return -1;
} | [
"public",
"static",
"int",
"indexFrom",
"(",
"String",
"s",
",",
"String",
"chars",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"s",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"if",
"(",
"chars",
".",
"indexOf",
"(",
"s",
".... | returns the next index of a character from the chars string | [
"returns",
"the",
"next",
"index",
"of",
"a",
"character",
"from",
"the",
"chars",
"string"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java#L170-L176 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java | StringUtil.replace | public static String replace(String s, String sub, String with)
{
int c=0;
int i=s.indexOf(sub,c);
if (i == -1)
return s;
StringBuffer buf = new StringBuffer(s.length()+with.length());
synchronized(buf)
{
do
{
... | java | public static String replace(String s, String sub, String with)
{
int c=0;
int i=s.indexOf(sub,c);
if (i == -1)
return s;
StringBuffer buf = new StringBuffer(s.length()+with.length());
synchronized(buf)
{
do
{
... | [
"public",
"static",
"String",
"replace",
"(",
"String",
"s",
",",
"String",
"sub",
",",
"String",
"with",
")",
"{",
"int",
"c",
"=",
"0",
";",
"int",
"i",
"=",
"s",
".",
"indexOf",
"(",
"sub",
",",
"c",
")",
";",
"if",
"(",
"i",
"==",
"-",
"1... | replace substrings within string. | [
"replace",
"substrings",
"within",
"string",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java#L182-L205 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Element.java | Element.setAttributesFrom | public Element setAttributesFrom(Element e)
{
attributes=e.attributes;
attributeMap=(Hashtable)e.attributeMap.clone();
return this;
} | java | public Element setAttributesFrom(Element e)
{
attributes=e.attributes;
attributeMap=(Hashtable)e.attributeMap.clone();
return this;
} | [
"public",
"Element",
"setAttributesFrom",
"(",
"Element",
"e",
")",
"{",
"attributes",
"=",
"e",
".",
"attributes",
";",
"attributeMap",
"=",
"(",
"Hashtable",
")",
"e",
".",
"attributeMap",
".",
"clone",
"(",
")",
";",
"return",
"this",
";",
"}"
] | Set attributes from another Element.
@param e Element
@return This Element | [
"Set",
"attributes",
"from",
"another",
"Element",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Element.java#L199-L204 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/Pool.java | Pool.setPoolClass | public void setPoolClass(Class poolClass)
throws IllegalStateException
{
synchronized(this)
{
if (_class!=poolClass)
{
if (_running>0)
throw new IllegalStateException("Thread Pool Running");
if (!PondLife.class.isAss... | java | public void setPoolClass(Class poolClass)
throws IllegalStateException
{
synchronized(this)
{
if (_class!=poolClass)
{
if (_running>0)
throw new IllegalStateException("Thread Pool Running");
if (!PondLife.class.isAss... | [
"public",
"void",
"setPoolClass",
"(",
"Class",
"poolClass",
")",
"throws",
"IllegalStateException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"_class",
"!=",
"poolClass",
")",
"{",
"if",
"(",
"_running",
">",
"0",
")",
"throw",
"new",
"Illega... | Set the class.
@param poolClass The class
@exception IllegalStateException If the pool has already
been started. | [
"Set",
"the",
"class",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Pool.java#L121-L136 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java | ServletHolder.compareTo | public int compareTo(Object o)
{
if (o instanceof ServletHolder)
{
ServletHolder sh= (ServletHolder)o;
if (sh==this)
return 0;
if (sh._initOrder<_initOrder)
return 1;
if (sh._initOrder>_initOrder)
return ... | java | public int compareTo(Object o)
{
if (o instanceof ServletHolder)
{
ServletHolder sh= (ServletHolder)o;
if (sh==this)
return 0;
if (sh._initOrder<_initOrder)
return 1;
if (sh._initOrder>_initOrder)
return ... | [
"public",
"int",
"compareTo",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"ServletHolder",
")",
"{",
"ServletHolder",
"sh",
"=",
"(",
"ServletHolder",
")",
"o",
";",
"if",
"(",
"sh",
"==",
"this",
")",
"return",
"0",
";",
"if",
"(",
... | Comparitor by init order. | [
"Comparitor",
"by",
"init",
"order",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L124-L143 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java | ServletHolder.setUserRoleLink | public synchronized void setUserRoleLink(String name,String link)
{
if (_roleMap==null)
_roleMap=new HashMap();
_roleMap.put(name,link);
} | java | public synchronized void setUserRoleLink(String name,String link)
{
if (_roleMap==null)
_roleMap=new HashMap();
_roleMap.put(name,link);
} | [
"public",
"synchronized",
"void",
"setUserRoleLink",
"(",
"String",
"name",
",",
"String",
"link",
")",
"{",
"if",
"(",
"_roleMap",
"==",
"null",
")",
"_roleMap",
"=",
"new",
"HashMap",
"(",
")",
";",
"_roleMap",
".",
"put",
"(",
"name",
",",
"link",
"... | Link a user role.
Translate the role name used by a servlet, to the link name
used by the container.
@param name The role name as used by the servlet
@param link The role name as used by the container. | [
"Link",
"a",
"user",
"role",
".",
"Translate",
"the",
"role",
"name",
"used",
"by",
"a",
"servlet",
"to",
"the",
"link",
"name",
"used",
"by",
"the",
"container",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L170-L175 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java | ServletHolder.getUserRoleLink | public String getUserRoleLink(String name)
{
if (_roleMap==null)
return name;
String link=(String)_roleMap.get(name);
return (link==null)?name:link;
} | java | public String getUserRoleLink(String name)
{
if (_roleMap==null)
return name;
String link=(String)_roleMap.get(name);
return (link==null)?name:link;
} | [
"public",
"String",
"getUserRoleLink",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"_roleMap",
"==",
"null",
")",
"return",
"name",
";",
"String",
"link",
"=",
"(",
"String",
")",
"_roleMap",
".",
"get",
"(",
"name",
")",
";",
"return",
"(",
"link",
... | get a user role link.
@param name The name of the role
@return The name as translated by the link. If no link exists,
the name is returned. | [
"get",
"a",
"user",
"role",
"link",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L183-L189 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java | ServletHolder.getServlet | public synchronized Servlet getServlet()
throws ServletException
{
// Handle previous unavailability
if (_unavailable!=0)
{
if (_unavailable<0 || _unavailable>0 && System.currentTimeMillis()<_unavailable)
throw _unavailableEx;
_unavailable=0;
... | java | public synchronized Servlet getServlet()
throws ServletException
{
// Handle previous unavailability
if (_unavailable!=0)
{
if (_unavailable<0 || _unavailable>0 && System.currentTimeMillis()<_unavailable)
throw _unavailableEx;
_unavailable=0;
... | [
"public",
"synchronized",
"Servlet",
"getServlet",
"(",
")",
"throws",
"ServletException",
"{",
"// Handle previous unavailability",
"if",
"(",
"_unavailable",
"!=",
"0",
")",
"{",
"if",
"(",
"_unavailable",
"<",
"0",
"||",
"_unavailable",
">",
"0",
"&&",
"Syste... | Get the servlet.
@return The servlet | [
"Get",
"the",
"servlet",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L287-L345 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java | ServletHolder.handle | public void handle(ServletRequest request,
ServletResponse response)
throws ServletException,
UnavailableException,
IOException
{
if (_class==null)
throw new UnavailableException("Servlet Not Initialized");
Servlet ser... | java | public void handle(ServletRequest request,
ServletResponse response)
throws ServletException,
UnavailableException,
IOException
{
if (_class==null)
throw new UnavailableException("Servlet Not Initialized");
Servlet ser... | [
"public",
"void",
"handle",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"UnavailableException",
",",
"IOException",
"{",
"if",
"(",
"_class",
"==",
"null",
")",
"throw",
"new",
"UnavailableException",... | Service a request with this servlet. | [
"Service",
"a",
"request",
"with",
"this",
"servlet",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L389-L450 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java | FrameSet.nameFrame | public Frame nameFrame(String name,int col, int row)
{
if (frameMap==null)
{
frameMap=new Hashtable(10);
frameNames=new Vector(10);
}
Frame frame = frames[col][row];
if (frame==null)
frame = frames[col][row] = new Frame();
... | java | public Frame nameFrame(String name,int col, int row)
{
if (frameMap==null)
{
frameMap=new Hashtable(10);
frameNames=new Vector(10);
}
Frame frame = frames[col][row];
if (frame==null)
frame = frames[col][row] = new Frame();
... | [
"public",
"Frame",
"nameFrame",
"(",
"String",
"name",
",",
"int",
"col",
",",
"int",
"row",
")",
"{",
"if",
"(",
"frameMap",
"==",
"null",
")",
"{",
"frameMap",
"=",
"new",
"Hashtable",
"(",
"10",
")",
";",
"frameNames",
"=",
"new",
"Vector",
"(",
... | Name a frame.
By convention, frame names match Page section names | [
"Name",
"a",
"frame",
".",
"By",
"convention",
"frame",
"names",
"match",
"Page",
"section",
"names"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java#L116-L134 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java | HashUserRealm.load | public void load(String config)
throws IOException
{
_config=config;
if(log.isDebugEnabled())log.debug("Load "+this+" from "+config);
Properties properties = new Properties();
Resource resource=Resource.newResource(config);
properties.load(resource.getInputStream());
... | java | public void load(String config)
throws IOException
{
_config=config;
if(log.isDebugEnabled())log.debug("Load "+this+" from "+config);
Properties properties = new Properties();
Resource resource=Resource.newResource(config);
properties.load(resource.getInputStream());
... | [
"public",
"void",
"load",
"(",
"String",
"config",
")",
"throws",
"IOException",
"{",
"_config",
"=",
"config",
";",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"log",
".",
"debug",
"(",
"\"Load \"",
"+",
"this",
"+",
"\" from \"",
"+",
"co... | Load realm users from properties file.
The property file maps usernames to password specs followed by
an optional comma separated list of role names.
@param config Filename or url of user properties file.
@exception IOException | [
"Load",
"realm",
"users",
"from",
"properties",
"file",
".",
"The",
"property",
"file",
"maps",
"usernames",
"to",
"password",
"specs",
"followed",
"by",
"an",
"optional",
"comma",
"separated",
"list",
"of",
"role",
"names",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L127-L163 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java | HashUserRealm.put | public synchronized Object put(Object name, Object credentials)
{
if (credentials instanceof Principal)
return super.put(name.toString(),
credentials);
if (credentials instanceof Password)
return super.put(name,
... | java | public synchronized Object put(Object name, Object credentials)
{
if (credentials instanceof Principal)
return super.put(name.toString(),
credentials);
if (credentials instanceof Password)
return super.put(name,
... | [
"public",
"synchronized",
"Object",
"put",
"(",
"Object",
"name",
",",
"Object",
"credentials",
")",
"{",
"if",
"(",
"credentials",
"instanceof",
"Principal",
")",
"return",
"super",
".",
"put",
"(",
"name",
".",
"toString",
"(",
")",
",",
"credentials",
"... | Put user into realm.
@param name User name
@param credentials String password, Password or UserPrinciple
instance.
@return Old UserPrinciple value or null | [
"Put",
"user",
"into",
"realm",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L236-L252 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java | HashUserRealm.addUserToRole | public synchronized void addUserToRole(String userName, String roleName)
{
HashSet userSet = (HashSet)_roles.get(roleName);
if (userSet==null)
{
userSet=new HashSet(11);
_roles.put(roleName,userSet);
}
userSet.add(userName);
} | java | public synchronized void addUserToRole(String userName, String roleName)
{
HashSet userSet = (HashSet)_roles.get(roleName);
if (userSet==null)
{
userSet=new HashSet(11);
_roles.put(roleName,userSet);
}
userSet.add(userName);
} | [
"public",
"synchronized",
"void",
"addUserToRole",
"(",
"String",
"userName",
",",
"String",
"roleName",
")",
"{",
"HashSet",
"userSet",
"=",
"(",
"HashSet",
")",
"_roles",
".",
"get",
"(",
"roleName",
")",
";",
"if",
"(",
"userSet",
"==",
"null",
")",
"... | Add a user to a role.
@param userName
@param roleName | [
"Add",
"a",
"user",
"to",
"a",
"role",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L259-L268 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java | HashUserRealm.isUserInRole | public synchronized boolean isUserInRole(Principal user, String roleName)
{
if (user instanceof WrappedUser)
return ((WrappedUser)user).isUserInRole(roleName);
if (user==null || ((User)user).getUserRealm()!=this)
return false;
HashSet userSet = (Has... | java | public synchronized boolean isUserInRole(Principal user, String roleName)
{
if (user instanceof WrappedUser)
return ((WrappedUser)user).isUserInRole(roleName);
if (user==null || ((User)user).getUserRealm()!=this)
return false;
HashSet userSet = (Has... | [
"public",
"synchronized",
"boolean",
"isUserInRole",
"(",
"Principal",
"user",
",",
"String",
"roleName",
")",
"{",
"if",
"(",
"user",
"instanceof",
"WrappedUser",
")",
"return",
"(",
"(",
"WrappedUser",
")",
"user",
")",
".",
"isUserInRole",
"(",
"roleName",
... | Check if a user is in a role.
@param user The user, which must be from this realm
@param roleName
@return True if the user can act in the role. | [
"Check",
"if",
"a",
"user",
"is",
"in",
"a",
"role",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L282-L292 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/FileResource.java | FileResource.list | public String[] list()
{
String[] list =_file.list();
if (list==null)
return null;
for (int i=list.length;i-->0;)
{
if (new File(_file,list[i]).isDirectory() &&
!list[i].endsWith("/"))
list[i]+="/";
}
return list... | java | public String[] list()
{
String[] list =_file.list();
if (list==null)
return null;
for (int i=list.length;i-->0;)
{
if (new File(_file,list[i]).isDirectory() &&
!list[i].endsWith("/"))
list[i]+="/";
}
return list... | [
"public",
"String",
"[",
"]",
"list",
"(",
")",
"{",
"String",
"[",
"]",
"list",
"=",
"_file",
".",
"list",
"(",
")",
";",
"if",
"(",
"list",
"==",
"null",
")",
"return",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"list",
".",
"length",
";",
"... | Returns a list of resources contained in the given resource | [
"Returns",
"a",
"list",
"of",
"resources",
"contained",
"in",
"the",
"given",
"resource"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/FileResource.java#L292-L304 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.mapPathToServlet | public ServletHolder mapPathToServlet(String pathSpec,
String servletName)
{
ServletHolder holder =(ServletHolder)_nameMap.get(servletName);
if (!pathSpec.startsWith("/") && !pathSpec.startsWith("*"))
{
log.warn("pathSpec should start wi... | java | public ServletHolder mapPathToServlet(String pathSpec,
String servletName)
{
ServletHolder holder =(ServletHolder)_nameMap.get(servletName);
if (!pathSpec.startsWith("/") && !pathSpec.startsWith("*"))
{
log.warn("pathSpec should start wi... | [
"public",
"ServletHolder",
"mapPathToServlet",
"(",
"String",
"pathSpec",
",",
"String",
"servletName",
")",
"{",
"ServletHolder",
"holder",
"=",
"(",
"ServletHolder",
")",
"_nameMap",
".",
"get",
"(",
"servletName",
")",
";",
"if",
"(",
"!",
"pathSpec",
".",
... | Map a servlet to a pathSpec
@param pathSpec The pathspec to map
@param servletName The name of the servlet, which must have already been added.
@return The servlet holder of the mapped servlet. | [
"Map",
"a",
"servlet",
"to",
"a",
"pathSpec"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L272-L287 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.addServletHolder | public void addServletHolder(ServletHolder holder)
{
ServletHolder existing = (ServletHolder)
_nameMap.get(holder.getName());
if (existing==null)
_nameMap.put(holder.getName(),holder);
else if (existing!=holder)
throw new IllegalArgumentException("Holder alrea... | java | public void addServletHolder(ServletHolder holder)
{
ServletHolder existing = (ServletHolder)
_nameMap.get(holder.getName());
if (existing==null)
_nameMap.put(holder.getName(),holder);
else if (existing!=holder)
throw new IllegalArgumentException("Holder alrea... | [
"public",
"void",
"addServletHolder",
"(",
"ServletHolder",
"holder",
")",
"{",
"ServletHolder",
"existing",
"=",
"(",
"ServletHolder",
")",
"_nameMap",
".",
"get",
"(",
"holder",
".",
"getName",
"(",
")",
")",
";",
"if",
"(",
"existing",
"==",
"null",
")"... | Register an existing ServletHolder with this handler.
@param holder the ServletHolder to register. | [
"Register",
"an",
"existing",
"ServletHolder",
"with",
"this",
"handler",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L349-L358 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.getServlets | public ServletHolder[] getServlets()
{
// Sort and Initialize servlets
HashSet holder_set = new HashSet(_nameMap.size());
holder_set.addAll(_nameMap.values());
ServletHolder holders [] = (ServletHolder [])
holder_set.toArray(new ServletHolder [holder_set.size()]);
... | java | public ServletHolder[] getServlets()
{
// Sort and Initialize servlets
HashSet holder_set = new HashSet(_nameMap.size());
holder_set.addAll(_nameMap.values());
ServletHolder holders [] = (ServletHolder [])
holder_set.toArray(new ServletHolder [holder_set.size()]);
... | [
"public",
"ServletHolder",
"[",
"]",
"getServlets",
"(",
")",
"{",
"// Sort and Initialize servlets",
"HashSet",
"holder_set",
"=",
"new",
"HashSet",
"(",
"_nameMap",
".",
"size",
"(",
")",
")",
";",
"holder_set",
".",
"addAll",
"(",
"_nameMap",
".",
"values",... | Get Servlets.
@return Array of defined servlets | [
"Get",
"Servlets",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L398-L407 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.initializeServlets | public void initializeServlets()
throws Exception
{
MultiException mx = new MultiException();
// Sort and Initialize servlets
ServletHolder[] holders = getServlets();
for (int i=0; i<holders.length; i++)
{
try{holders[i].start();}
catc... | java | public void initializeServlets()
throws Exception
{
MultiException mx = new MultiException();
// Sort and Initialize servlets
ServletHolder[] holders = getServlets();
for (int i=0; i<holders.length; i++)
{
try{holders[i].start();}
catc... | [
"public",
"void",
"initializeServlets",
"(",
")",
"throws",
"Exception",
"{",
"MultiException",
"mx",
"=",
"new",
"MultiException",
"(",
")",
";",
"// Sort and Initialize servlets",
"ServletHolder",
"[",
"]",
"holders",
"=",
"getServlets",
"(",
")",
";",
"for",
... | Initialize load-on-startup servlets.
Called automatically from start if autoInitializeServlet is true. | [
"Initialize",
"load",
"-",
"on",
"-",
"startup",
"servlets",
".",
"Called",
"automatically",
"from",
"start",
"if",
"autoInitializeServlet",
"is",
"true",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L413-L430 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.getResource | public URL getResource(String uriInContext)
throws MalformedURLException
{
if (uriInContext==null || !uriInContext.startsWith("/"))
throw new MalformedURLException(uriInContext);
try{
Resource resource = getHttpContext().getResource(uriInContext);
... | java | public URL getResource(String uriInContext)
throws MalformedURLException
{
if (uriInContext==null || !uriInContext.startsWith("/"))
throw new MalformedURLException(uriInContext);
try{
Resource resource = getHttpContext().getResource(uriInContext);
... | [
"public",
"URL",
"getResource",
"(",
"String",
"uriInContext",
")",
"throws",
"MalformedURLException",
"{",
"if",
"(",
"uriInContext",
"==",
"null",
"||",
"!",
"uriInContext",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"throw",
"new",
"MalformedURLException",
"(... | Get a Resource.
If no resource is found, resource aliases are tried.
@param uriInContext
@return URL of the resource.
@exception MalformedURLException | [
"Get",
"a",
"Resource",
".",
"If",
"no",
"resource",
"is",
"found",
"resource",
"aliases",
"are",
"tried",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L704-L728 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.getNamedDispatcher | public RequestDispatcher getNamedDispatcher(String name)
{
if (name == null || name.length()==0)
name=__DEFAULT_SERVLET;
try { return new Dispatcher(ServletHandler.this,name); }
catch(Exception e) {LogSupport.ignore(log,e);}
return null;
} | java | public RequestDispatcher getNamedDispatcher(String name)
{
if (name == null || name.length()==0)
name=__DEFAULT_SERVLET;
try { return new Dispatcher(ServletHandler.this,name); }
catch(Exception e) {LogSupport.ignore(log,e);}
return null;
} | [
"public",
"RequestDispatcher",
"getNamedDispatcher",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
"==",
"null",
"||",
"name",
".",
"length",
"(",
")",
"==",
"0",
")",
"name",
"=",
"__DEFAULT_SERVLET",
";",
"try",
"{",
"return",
"new",
"Dispatcher",
... | Get Named dispatcher.
@param name The name of the servlet. If null or empty string, the
containers default servlet is returned.
@return Request dispatcher for the named servlet. | [
"Get",
"Named",
"dispatcher",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L821-L830 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.getContextAttribute | protected Object getContextAttribute(String name)
{
if (ServletHandler.__J_S_CONTEXT_TEMPDIR.equals(name))
{
// Initialize temporary directory
Object t = getHttpContext().getAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR);
if (t instanceof File)
r... | java | protected Object getContextAttribute(String name)
{
if (ServletHandler.__J_S_CONTEXT_TEMPDIR.equals(name))
{
// Initialize temporary directory
Object t = getHttpContext().getAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR);
if (t instanceof File)
r... | [
"protected",
"Object",
"getContextAttribute",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"ServletHandler",
".",
"__J_S_CONTEXT_TEMPDIR",
".",
"equals",
"(",
"name",
")",
")",
"{",
"// Initialize temporary directory",
"Object",
"t",
"=",
"getHttpContext",
"(",
")"... | Get context attribute.
Tries ServletHandler attributes and then delegated to HttpContext.
@param name attribute name.
@return attribute | [
"Get",
"context",
"attribute",
".",
"Tries",
"ServletHandler",
"attributes",
"and",
"then",
"delegated",
"to",
"HttpContext",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L906-L922 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java | ServletHandler.getContextAttributeNames | protected Enumeration getContextAttributeNames()
{
if (_attributes.size()==0)
return getHttpContext().getAttributeNames();
HashSet set=new HashSet(_attributes.keySet());
Enumeration e=getHttpContext().getAttributeNames();
while(e.hasMoreElements())
set.add(e.n... | java | protected Enumeration getContextAttributeNames()
{
if (_attributes.size()==0)
return getHttpContext().getAttributeNames();
HashSet set=new HashSet(_attributes.keySet());
Enumeration e=getHttpContext().getAttributeNames();
while(e.hasMoreElements())
set.add(e.n... | [
"protected",
"Enumeration",
"getContextAttributeNames",
"(",
")",
"{",
"if",
"(",
"_attributes",
".",
"size",
"(",
")",
"==",
"0",
")",
"return",
"getHttpContext",
"(",
")",
".",
"getAttributeNames",
"(",
")",
";",
"HashSet",
"set",
"=",
"new",
"HashSet",
... | Get context attribute names.
Combines ServletHandler and HttpContext attributes. | [
"Get",
"context",
"attribute",
"names",
".",
"Combines",
"ServletHandler",
"and",
"HttpContext",
"attributes",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L928-L937 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java | XmlConfiguration.configure | public void configure(Object obj) throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, InstantiationException, IllegalAccessException
{
//Check the class of the object
Class oClass = nodeClass(_config);
if (oClass != null)
{
if (obj... | java | public void configure(Object obj) throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, InstantiationException, IllegalAccessException
{
//Check the class of the object
Class oClass = nodeClass(_config);
if (oClass != null)
{
if (obj... | [
"public",
"void",
"configure",
"(",
"Object",
"obj",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"//Check the class of the object",
"Class",
"oClass... | Configure an object. If the object is of the approprate class, the XML configuration script
is applied to the object.
@param obj The object to be configured.
@exception ClassNotFoundException
@exception NoSuchMethodException
@exception InvocationTargetException
@throws IllegalAccessException
@throws InstantiationExcep... | [
"Configure",
"an",
"object",
".",
"If",
"the",
"object",
"is",
"of",
"the",
"approprate",
"class",
"the",
"XML",
"configuration",
"script",
"is",
"applied",
"to",
"the",
"object",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java#L158-L170 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java | XmlConfiguration.newInstance | public Object newInstance() throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, InstantiationException, IllegalAccessException
{
Class oClass = nodeClass(_config);
Object obj = null;
if (oClass != null) obj = oClass.newInstance();
configure(ob... | java | public Object newInstance() throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, InstantiationException, IllegalAccessException
{
Class oClass = nodeClass(_config);
Object obj = null;
if (oClass != null) obj = oClass.newInstance();
configure(ob... | [
"public",
"Object",
"newInstance",
"(",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"InvocationTargetException",
",",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"Class",
"oClass",
"=",
"nodeClass",
"(",
"_config",
")",
... | Create a new object and configure it. A new object is created and configured.
@return The newly created configured object.
@exception ClassNotFoundException
@exception NoSuchMethodException
@exception InvocationTargetException
@exception InstantiationException
@exception IllegalAccessException | [
"Create",
"a",
"new",
"object",
"and",
"configure",
"it",
".",
"A",
"new",
"object",
"is",
"created",
"and",
"configured",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java#L183-L191 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/jetty/servlet/JettyWebConfiguration.java | JettyWebConfiguration.configureWebApp | public void configureWebApp () throws Exception
{
//cannot configure if the _context is already started
if (_context.isStarted())
{
if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");};
return;
}
if(log.isDebugE... | java | public void configureWebApp () throws Exception
{
//cannot configure if the _context is already started
if (_context.isStarted())
{
if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");};
return;
}
if(log.isDebugE... | [
"public",
"void",
"configureWebApp",
"(",
")",
"throws",
"Exception",
"{",
"//cannot configure if the _context is already started",
"if",
"(",
"_context",
".",
"isStarted",
"(",
")",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
... | configureWebApp
Apply web-jetty.xml configuration
@see org.browsermob.proxy.jetty.jetty.servlet.WebApplicationContext.Configuration#configureWebApp() | [
"configureWebApp",
"Apply",
"web",
"-",
"jetty",
".",
"xml",
"configuration"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/JettyWebConfiguration.java#L72-L119 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java | HttpContext.addVirtualHost | public void addVirtualHost(String hostname)
{
// Note that null hosts are also added.
if (!_vhosts.contains(hostname))
{
_vhosts.add(hostname);
_contextName=null;
if (_httpServer!=null)
{
if (_vhosts.size()==1)
... | java | public void addVirtualHost(String hostname)
{
// Note that null hosts are also added.
if (!_vhosts.contains(hostname))
{
_vhosts.add(hostname);
_contextName=null;
if (_httpServer!=null)
{
if (_vhosts.size()==1)
... | [
"public",
"void",
"addVirtualHost",
"(",
"String",
"hostname",
")",
"{",
"// Note that null hosts are also added.",
"if",
"(",
"!",
"_vhosts",
".",
"contains",
"(",
"hostname",
")",
")",
"{",
"_vhosts",
".",
"add",
"(",
"hostname",
")",
";",
"_contextName",
"=... | Add a virtual host alias to this context.
@see #setVirtualHosts
@param hostname A hostname. A null host name means any hostname is
acceptable. Host names may String representation of IP addresses. | [
"Add",
"a",
"virtual",
"host",
"alias",
"to",
"this",
"context",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java#L272-L288 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java | HttpContext.removeVirtualHost | public void removeVirtualHost(String hostname)
{
// Note that null hosts are also added.
if (_vhosts.remove(hostname))
{
_contextName=null;
if (_httpServer!=null)
{
_httpServer.removeMapping(hostname,this);
if (_vhosts.size(... | java | public void removeVirtualHost(String hostname)
{
// Note that null hosts are also added.
if (_vhosts.remove(hostname))
{
_contextName=null;
if (_httpServer!=null)
{
_httpServer.removeMapping(hostname,this);
if (_vhosts.size(... | [
"public",
"void",
"removeVirtualHost",
"(",
"String",
"hostname",
")",
"{",
"// Note that null hosts are also added.",
"if",
"(",
"_vhosts",
".",
"remove",
"(",
"hostname",
")",
")",
"{",
"_contextName",
"=",
"null",
";",
"if",
"(",
"_httpServer",
"!=",
"null",
... | remove a virtual host alias to this context.
@see #setVirtualHosts
@param hostname A hostname. A null host name means any hostname is
acceptable. Host names may String representation of IP addresses. | [
"remove",
"a",
"virtual",
"host",
"alias",
"to",
"this",
"context",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java#L296-L310 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.prewrite | public void prewrite(byte[] b)
{
ensureReserve(b.length);
System.arraycopy(b,0,_buf,_start-b.length,b.length);
_start-=b.length;
} | java | public void prewrite(byte[] b)
{
ensureReserve(b.length);
System.arraycopy(b,0,_buf,_start-b.length,b.length);
_start-=b.length;
} | [
"public",
"void",
"prewrite",
"(",
"byte",
"[",
"]",
"b",
")",
"{",
"ensureReserve",
"(",
"b",
".",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"0",
",",
"_buf",
",",
"_start",
"-",
"b",
".",
"length",
",",
"b",
".",
"length",
... | Write byte array to start of the buffer.
@param b | [
"Write",
"byte",
"array",
"to",
"start",
"of",
"the",
"buffer",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L217-L222 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.prewrite | public void prewrite(byte[] b,int offset, int length)
{
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | java | public void prewrite(byte[] b,int offset, int length)
{
ensureReserve(length);
System.arraycopy(b,offset,_buf,_start-length,length);
_start-=length;
} | [
"public",
"void",
"prewrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"ensureReserve",
"(",
"length",
")",
";",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",
"_start",
"-",
"length",
... | Write byte range to start of the buffer.
@param b
@param offset
@param length | [
"Write",
"byte",
"range",
"to",
"start",
"of",
"the",
"buffer",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L230-L235 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java | ByteBufferOutputStream.postwrite | public void postwrite(byte[] b,int offset, int length)
throws IOException
{
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | java | public void postwrite(byte[] b,int offset, int length)
throws IOException
{
System.arraycopy(b,offset,_buf,_pos,length);
_pos+=length;
} | [
"public",
"void",
"postwrite",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"System",
".",
"arraycopy",
"(",
"b",
",",
"offset",
",",
"_buf",
",",
"_pos",
",",
"length",
")",
";",
"_pos",
... | Write bytes into the postreserve.
The capacity is not checked.
@param b
@param offset
@param length
@exception IOException | [
"Write",
"bytes",
"into",
"the",
"postreserve",
".",
"The",
"capacity",
"is",
"not",
"checked",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L259-L264 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java | AJP13Listener.createConnection | protected AJP13Connection createConnection(Socket socket) throws IOException
{
return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize());
} | java | protected AJP13Connection createConnection(Socket socket) throws IOException
{
return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize());
} | [
"protected",
"AJP13Connection",
"createConnection",
"(",
"Socket",
"socket",
")",
"throws",
"IOException",
"{",
"return",
"new",
"AJP13Connection",
"(",
"this",
",",
"socket",
".",
"getInputStream",
"(",
")",
",",
"socket",
".",
"getOutputStream",
"(",
")",
",",... | Create an AJP13Connection instance. This method can be used to override
the connection instance.
@param socket
The underlying socket. | [
"Create",
"an",
"AJP13Connection",
"instance",
".",
"This",
"method",
"can",
"be",
"used",
"to",
"override",
"the",
"connection",
"instance",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java#L223-L226 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Link.java | Link.target | public Link target(String t)
{
if (t!=null && t.length()>0)
attribute("target",t);
return this;
} | java | public Link target(String t)
{
if (t!=null && t.length()>0)
attribute("target",t);
return this;
} | [
"public",
"Link",
"target",
"(",
"String",
"t",
")",
"{",
"if",
"(",
"t",
"!=",
"null",
"&&",
"t",
".",
"length",
"(",
")",
">",
"0",
")",
"attribute",
"(",
"\"target\"",
",",
"t",
")",
";",
"return",
"this",
";",
"}"
] | Set the link target frame. | [
"Set",
"the",
"link",
"target",
"frame",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Link.java#L51-L56 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Applet.java | Applet.write | public void write(Writer out)
throws IOException
{
if (codeBase != null)
attribute("codebase",codeBase);
if (debug)
paramHolder.add("<param name=\"debug\" value=\"yes\">");
if (params != null)
for (Enumeration enm = params.keys(); enm.has... | java | public void write(Writer out)
throws IOException
{
if (codeBase != null)
attribute("codebase",codeBase);
if (debug)
paramHolder.add("<param name=\"debug\" value=\"yes\">");
if (params != null)
for (Enumeration enm = params.keys(); enm.has... | [
"public",
"void",
"write",
"(",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"codeBase",
"!=",
"null",
")",
"attribute",
"(",
"\"codebase\"",
",",
"codeBase",
")",
";",
"if",
"(",
"debug",
")",
"paramHolder",
".",
"add",
"(",
"\"<param ... | Write out the HTML | [
"Write",
"out",
"the",
"HTML"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Applet.java#L123-L139 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Composite.java | Composite.add | public Composite add(Object o)
{
if (nest!=null)
nest.add(o);
else
{
if (o!=null)
{
if (o instanceof Element)
{
if(o instanceof Page)
throw new IllegalArgumentException("Can't inse... | java | public Composite add(Object o)
{
if (nest!=null)
nest.add(o);
else
{
if (o!=null)
{
if (o instanceof Element)
{
if(o instanceof Page)
throw new IllegalArgumentException("Can't inse... | [
"public",
"Composite",
"add",
"(",
"Object",
"o",
")",
"{",
"if",
"(",
"nest",
"!=",
"null",
")",
"nest",
".",
"add",
"(",
"o",
")",
";",
"else",
"{",
"if",
"(",
"o",
"!=",
"null",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Element",
")",
"{",
... | Add an Object to the Composite by converting it to a Element or.
String
@param o The Object to add. If it is a String or Element, it is
added directly, otherwise toString() is called.
@return This Composite (for chained commands) | [
"Add",
"an",
"Object",
"to",
"the",
"Composite",
"by",
"converting",
"it",
"to",
"a",
"Element",
"or",
".",
"String"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L71-L92 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Composite.java | Composite.nest | public Composite nest(Composite c)
{
if (nest!=null)
return nest.nest(c);
else
{
add(c);
nest=c;
}
return this;
} | java | public Composite nest(Composite c)
{
if (nest!=null)
return nest.nest(c);
else
{
add(c);
nest=c;
}
return this;
} | [
"public",
"Composite",
"nest",
"(",
"Composite",
"c",
")",
"{",
"if",
"(",
"nest",
"!=",
"null",
")",
"return",
"nest",
".",
"nest",
"(",
"c",
")",
";",
"else",
"{",
"add",
"(",
"c",
")",
";",
"nest",
"=",
"c",
";",
"}",
"return",
"this",
";",
... | Nest a Composite within a Composite.
The passed Composite is added to this Composite. Adds to
this composite are actually added to the nested Composite.
Calls to nest are passed the nested Composite
@return The Composite to unest on to return to the original
state. | [
"Nest",
"a",
"Composite",
"within",
"a",
"Composite",
".",
"The",
"passed",
"Composite",
"is",
"added",
"to",
"this",
"Composite",
".",
"Adds",
"to",
"this",
"composite",
"are",
"actually",
"added",
"to",
"the",
"nested",
"Composite",
".",
"Calls",
"to",
"... | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L102-L112 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Composite.java | Composite.write | public void write(Writer out)
throws IOException
{
for (int i=0; i <elements.size() ; i++)
{
Object element = elements.get(i);
if (element instanceof Element)
((Element)element).write(out);
else if (element==null)
... | java | public void write(Writer out)
throws IOException
{
for (int i=0; i <elements.size() ; i++)
{
Object element = elements.get(i);
if (element instanceof Element)
((Element)element).write(out);
else if (element==null)
... | [
"public",
"void",
"write",
"(",
"Writer",
"out",
")",
"throws",
"IOException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"size",
"(",
")",
";",
"i",
"++",
")",
"{",
"Object",
"element",
"=",
"elements",
".",
"get",
"(... | Write the composite.
The default implementation writes the elements sequentially. May
be overridden for more specialized behaviour.
@param out Writer to write the element to. | [
"Write",
"the",
"composite",
".",
"The",
"default",
"implementation",
"writes",
"the",
"elements",
"sequentially",
".",
"May",
"be",
"overridden",
"for",
"more",
"specialized",
"behaviour",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L155-L169 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Composite.java | Composite.contents | public String contents()
{
StringBuffer buf = new StringBuffer();
synchronized(buf)
{
for (int i=0; i <elements.size() ; i++)
{
Object element = elements.get(i);
if (element==null)
buf.append("null");
... | java | public String contents()
{
StringBuffer buf = new StringBuffer();
synchronized(buf)
{
for (int i=0; i <elements.size() ; i++)
{
Object element = elements.get(i);
if (element==null)
buf.append("null");
... | [
"public",
"String",
"contents",
"(",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"synchronized",
"(",
"buf",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"elements",
".",
"size",
"(",
")",
";",
"i",
"... | Contents of the composite. | [
"Contents",
"of",
"the",
"composite",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L174-L189 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/html/Composite.java | Composite.replace | public boolean replace(Object oldObj, Object newObj)
{
if (nest != null)
{
return nest.replace(oldObj, newObj);
}
else
{
int sz = elements.size();
for (int i = 0; i < sz; i++)
{
if (elements.get(i) == oldObj)
... | java | public boolean replace(Object oldObj, Object newObj)
{
if (nest != null)
{
return nest.replace(oldObj, newObj);
}
else
{
int sz = elements.size();
for (int i = 0; i < sz; i++)
{
if (elements.get(i) == oldObj)
... | [
"public",
"boolean",
"replace",
"(",
"Object",
"oldObj",
",",
"Object",
"newObj",
")",
"{",
"if",
"(",
"nest",
"!=",
"null",
")",
"{",
"return",
"nest",
".",
"replace",
"(",
"oldObj",
",",
"newObj",
")",
";",
"}",
"else",
"{",
"int",
"sz",
"=",
"el... | Replace an object within the composite. | [
"Replace",
"an",
"object",
"within",
"the",
"composite",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L239-L259 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java | OutputStreamLogSink.log | public synchronized void log(String formattedLog)
{
if (_reopen || _out==null)
{
stop();
start();
}
try
{
_buffer.write(formattedLog);
_buffer.write(StringUtil.__LINE_SEPARATOR);
if (_flushOn || _buffer.size()>_buffe... | java | public synchronized void log(String formattedLog)
{
if (_reopen || _out==null)
{
stop();
start();
}
try
{
_buffer.write(formattedLog);
_buffer.write(StringUtil.__LINE_SEPARATOR);
if (_flushOn || _buffer.size()>_buffe... | [
"public",
"synchronized",
"void",
"log",
"(",
"String",
"formattedLog",
")",
"{",
"if",
"(",
"_reopen",
"||",
"_out",
"==",
"null",
")",
"{",
"stop",
"(",
")",
";",
"start",
"(",
")",
";",
"}",
"try",
"{",
"_buffer",
".",
"write",
"(",
"formattedLog"... | Log a message.
The formatted log string is written to the log sink. The default
implementation writes the message to an outputstream.
@param formattedLog | [
"Log",
"a",
"message",
".",
"The",
"formatted",
"log",
"string",
"is",
"written",
"to",
"the",
"log",
"sink",
".",
"The",
"default",
"implementation",
"writes",
"the",
"message",
"to",
"an",
"outputstream",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L395-L414 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java | OutputStreamLogSink.start | public synchronized void start()
{
_buffer=new ByteArrayISO8859Writer(_bufferSize);
_reopen=false;
if (_started)
return;
if (_out==null && _filename!=null)
{
try
{
RolloverFileOutputStream rfos=
... | java | public synchronized void start()
{
_buffer=new ByteArrayISO8859Writer(_bufferSize);
_reopen=false;
if (_started)
return;
if (_out==null && _filename!=null)
{
try
{
RolloverFileOutputStream rfos=
... | [
"public",
"synchronized",
"void",
"start",
"(",
")",
"{",
"_buffer",
"=",
"new",
"ByteArrayISO8859Writer",
"(",
"_bufferSize",
")",
";",
"_reopen",
"=",
"false",
";",
"if",
"(",
"_started",
")",
"return",
";",
"if",
"(",
"_out",
"==",
"null",
"&&",
"_fil... | Start a log sink.
The default implementation does nothing | [
"Start",
"a",
"log",
"sink",
".",
"The",
"default",
"implementation",
"does",
"nothing"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L421-L443 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java | OutputStreamLogSink.stop | public synchronized void stop()
{
_started=false;
if (_out!=null)
{
try
{
if (_buffer.size()>0)
{
_buffer.writeTo(_out);
}
_out.flush();
_buffer=null;
}
... | java | public synchronized void stop()
{
_started=false;
if (_out!=null)
{
try
{
if (_buffer.size()>0)
{
_buffer.writeTo(_out);
}
_out.flush();
_buffer=null;
}
... | [
"public",
"synchronized",
"void",
"stop",
"(",
")",
"{",
"_started",
"=",
"false",
";",
"if",
"(",
"_out",
"!=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"_buffer",
".",
"size",
"(",
")",
">",
"0",
")",
"{",
"_buffer",
".",
"writeTo",
"(",
"_out"... | Stop a log sink.
An opportunity for subclasses to clean up. The default
implementation does nothing | [
"Stop",
"a",
"log",
"sink",
".",
"An",
"opportunity",
"for",
"subclasses",
"to",
"clean",
"up",
".",
"The",
"default",
"implementation",
"does",
"nothing"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L451-L478 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java | MultiPartRequest.getPartNames | public String[] getPartNames()
{
Set s = _partMap.keySet();
return (String[]) s.toArray(new String[s.size()]);
} | java | public String[] getPartNames()
{
Set s = _partMap.keySet();
return (String[]) s.toArray(new String[s.size()]);
} | [
"public",
"String",
"[",
"]",
"getPartNames",
"(",
")",
"{",
"Set",
"s",
"=",
"_partMap",
".",
"keySet",
"(",
")",
";",
"return",
"(",
"String",
"[",
"]",
")",
"s",
".",
"toArray",
"(",
"new",
"String",
"[",
"s",
".",
"size",
"(",
")",
"]",
")"... | Get the part names.
@return an array of part names | [
"Get",
"the",
"part",
"names",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L99-L103 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java | MultiPartRequest.contains | public boolean contains(String name)
{
Part part = (Part)_partMap.get(name);
return (part!=null);
} | java | public boolean contains(String name)
{
Part part = (Part)_partMap.get(name);
return (part!=null);
} | [
"public",
"boolean",
"contains",
"(",
"String",
"name",
")",
"{",
"Part",
"part",
"=",
"(",
"Part",
")",
"_partMap",
".",
"get",
"(",
"name",
")",
";",
"return",
"(",
"part",
"!=",
"null",
")",
";",
"}"
] | Check if a named part is present
@param name The part
@return true if it was included | [
"Check",
"if",
"a",
"named",
"part",
"is",
"present"
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L110-L114 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java | MultiPartRequest.getString | public String getString(String name)
{
List part = _partMap.getValues(name);
if (part==null)
return null;
if (_encoding != null)
{
try
{
return new String(((Part)part.get(0))._data, _encoding);
}
catch (Uns... | java | public String getString(String name)
{
List part = _partMap.getValues(name);
if (part==null)
return null;
if (_encoding != null)
{
try
{
return new String(((Part)part.get(0))._data, _encoding);
}
catch (Uns... | [
"public",
"String",
"getString",
"(",
"String",
"name",
")",
"{",
"List",
"part",
"=",
"_partMap",
".",
"getValues",
"(",
"name",
")",
";",
"if",
"(",
"part",
"==",
"null",
")",
"return",
"null",
";",
"if",
"(",
"_encoding",
"!=",
"null",
")",
"{",
... | Get the data of a part as a string.
@param name The part name
@return The part data | [
"Get",
"the",
"data",
"of",
"a",
"part",
"as",
"a",
"string",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L121-L140 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java | MultiPartRequest.getInputStream | public InputStream getInputStream(String name)
{
List part = (List)_partMap.getValues(name);
if (part==null)
return null;
return new ByteArrayInputStream(((Part)part.get(0))._data);
} | java | public InputStream getInputStream(String name)
{
List part = (List)_partMap.getValues(name);
if (part==null)
return null;
return new ByteArrayInputStream(((Part)part.get(0))._data);
} | [
"public",
"InputStream",
"getInputStream",
"(",
"String",
"name",
")",
"{",
"List",
"part",
"=",
"(",
"List",
")",
"_partMap",
".",
"getValues",
"(",
"name",
")",
";",
"if",
"(",
"part",
"==",
"null",
")",
"return",
"null",
";",
"return",
"new",
"ByteA... | Get the data of a part as a stream.
@param name The part name
@return Stream providing the part data | [
"Get",
"the",
"data",
"of",
"a",
"part",
"as",
"a",
"stream",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L181-L187 | train |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java | MultiPartRequest.getParams | public Hashtable getParams(String name)
{
List part = (List)_partMap.getValues(name);
if (part==null)
return null;
return ((Part)part.get(0))._headers;
} | java | public Hashtable getParams(String name)
{
List part = (List)_partMap.getValues(name);
if (part==null)
return null;
return ((Part)part.get(0))._headers;
} | [
"public",
"Hashtable",
"getParams",
"(",
"String",
"name",
")",
"{",
"List",
"part",
"=",
"(",
"List",
")",
"_partMap",
".",
"getValues",
"(",
"name",
")",
";",
"if",
"(",
"part",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"(",
"Part",
... | Get the MIME parameters associated with a part.
@param name The part name
@return Hashtable of parameters | [
"Get",
"the",
"MIME",
"parameters",
"associated",
"with",
"a",
"part",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L207-L213 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.