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/ServletHttpResponse.java
ServletHttpResponse.unwrap
public static ServletHttpResponse unwrap(ServletResponse response) { while (!(response instanceof ServletHttpResponse)) { if (response instanceof ServletResponseWrapper) { ServletResponseWrapper wrapper = (ServletResponseWrapper)response; ...
java
public static ServletHttpResponse unwrap(ServletResponse response) { while (!(response instanceof ServletHttpResponse)) { if (response instanceof ServletResponseWrapper) { ServletResponseWrapper wrapper = (ServletResponseWrapper)response; ...
[ "public", "static", "ServletHttpResponse", "unwrap", "(", "ServletResponse", "response", ")", "{", "while", "(", "!", "(", "response", "instanceof", "ServletHttpResponse", ")", ")", "{", "if", "(", "response", "instanceof", "ServletResponseWrapper", ")", "{", "Ser...
Unwrap a ServletResponse. @see javax.servlet.ServletResponseWrapper @see javax.servlet.http.HttpServletResponseWrapper @param response @return The core ServletHttpResponse which must be the underlying response object
[ "Unwrap", "a", "ServletResponse", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpResponse.java#L678-L693
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.toArray
public static int[] toArray(String s, int family) { byte[] byteArray = toByteArray(s, family); if (byteArray == null) return null; int[] intArray = new int[byteArray.length]; for (int i = 0; i < byteArray.length; i++) intArray[i] = byteArray[i] & 0xFF; ...
java
public static int[] toArray(String s, int family) { byte[] byteArray = toByteArray(s, family); if (byteArray == null) return null; int[] intArray = new int[byteArray.length]; for (int i = 0; i < byteArray.length; i++) intArray[i] = byteArray[i] & 0xFF; ...
[ "public", "static", "int", "[", "]", "toArray", "(", "String", "s", ",", "int", "family", ")", "{", "byte", "[", "]", "byteArray", "=", "toByteArray", "(", "s", ",", "family", ")", ";", "if", "(", "byteArray", "==", "null", ")", "return", "null", "...
Convert a string containing an IP address to an array of 4 or 16 integers. @param s The address, in text format. @param family The address family. @return The address
[ "Convert", "a", "string", "containing", "an", "IP", "address", "to", "an", "array", "of", "4", "or", "16", "integers", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L168-L177
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.toByteArray
public static byte[] toByteArray(String s, int family) { if (family == IPv4) return parseV4(s); else if (family == IPv6) return parseV6(s); else throw new IllegalArgumentException("unknown address family"); }
java
public static byte[] toByteArray(String s, int family) { if (family == IPv4) return parseV4(s); else if (family == IPv6) return parseV6(s); else throw new IllegalArgumentException("unknown address family"); }
[ "public", "static", "byte", "[", "]", "toByteArray", "(", "String", "s", ",", "int", "family", ")", "{", "if", "(", "family", "==", "IPv4", ")", "return", "parseV4", "(", "s", ")", ";", "else", "if", "(", "family", "==", "IPv6", ")", "return", "par...
Convert a string containing an IP address to an array of 4 or 16 bytes. @param s The address, in text format. @param family The address family. @return The address
[ "Convert", "a", "string", "containing", "an", "IP", "address", "to", "an", "array", "of", "4", "or", "16", "bytes", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L197-L205
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.isDottedQuad
public static boolean isDottedQuad(String s) { byte[] address = Address.toByteArray(s, IPv4); return (address != null); }
java
public static boolean isDottedQuad(String s) { byte[] address = Address.toByteArray(s, IPv4); return (address != null); }
[ "public", "static", "boolean", "isDottedQuad", "(", "String", "s", ")", "{", "byte", "[", "]", "address", "=", "Address", ".", "toByteArray", "(", "s", ",", "IPv4", ")", ";", "return", "(", "address", "!=", "null", ")", ";", "}" ]
Determines if a string contains a valid IP address. @param s The string @return Whether the string contains a valid IP address
[ "Determines", "if", "a", "string", "contains", "a", "valid", "IP", "address", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L213-L217
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByName
public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record[] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
java
public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record[] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
[ "public", "static", "InetAddress", "getByName", "(", "String", "name", ")", "throws", "UnknownHostException", "{", "try", "{", "return", "getByAddress", "(", "name", ")", ";", "}", "catch", "(", "UnknownHostException", "e", ")", "{", "Record", "[", "]", "rec...
Determines the IP address of a host @param name The hostname to look up @return The first matching IP address @throws UnknownHostException The hostname does not have any addresses
[ "Determines", "the", "IP", "address", "of", "a", "host" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L268-L276
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getAllByName
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
java
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
[ "public", "static", "InetAddress", "[", "]", "getAllByName", "(", "String", "name", ")", "throws", "UnknownHostException", "{", "try", "{", "InetAddress", "addr", "=", "getByAddress", "(", "name", ")", ";", "return", "new", "InetAddress", "[", "]", "{", "add...
Determines all IP address of a host @param name The hostname to look up @return All matching IP addresses @throws UnknownHostException The hostname does not have any addresses
[ "Determines", "all", "IP", "address", "of", "a", "host" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L285-L297
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByAddress
public static InetAddress getByAddress(String addr) throws UnknownHostException { byte[] bytes; bytes = toByteArray(addr, IPv4); if (bytes != null) return InetAddress.getByAddress(bytes); bytes = toByteArray(addr, IPv6); if (bytes != null) return InetA...
java
public static InetAddress getByAddress(String addr) throws UnknownHostException { byte[] bytes; bytes = toByteArray(addr, IPv4); if (bytes != null) return InetAddress.getByAddress(bytes); bytes = toByteArray(addr, IPv6); if (bytes != null) return InetA...
[ "public", "static", "InetAddress", "getByAddress", "(", "String", "addr", ")", "throws", "UnknownHostException", "{", "byte", "[", "]", "bytes", ";", "bytes", "=", "toByteArray", "(", "addr", ",", "IPv4", ")", ";", "if", "(", "bytes", "!=", "null", ")", ...
Converts an address from its string representation to an IP address. The address can be either IPv4 or IPv6. @param addr The address, in string form @return The IP addresses @throws UnknownHostException The address is not a valid IP address.
[ "Converts", "an", "address", "from", "its", "string", "representation", "to", "an", "IP", "address", ".", "The", "address", "can", "be", "either", "IPv4", "or", "IPv6", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L307-L317
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByAddress
public static InetAddress getByAddress(String addr, int family) throws UnknownHostException { if (family != IPv4 && family != IPv6) throw new IllegalArgumentException("unknown address family"); byte[] bytes; bytes = toByteArray(addr, family); if (bytes != null) ...
java
public static InetAddress getByAddress(String addr, int family) throws UnknownHostException { if (family != IPv4 && family != IPv6) throw new IllegalArgumentException("unknown address family"); byte[] bytes; bytes = toByteArray(addr, family); if (bytes != null) ...
[ "public", "static", "InetAddress", "getByAddress", "(", "String", "addr", ",", "int", "family", ")", "throws", "UnknownHostException", "{", "if", "(", "family", "!=", "IPv4", "&&", "family", "!=", "IPv6", ")", "throw", "new", "IllegalArgumentException", "(", "...
Converts an address from its string representation to an IP address in a particular family. @param addr The address, in string form @param family The address family, either IPv4 or IPv6. @return The IP addresses @throws UnknownHostException The address is not a valid IP address in the specified address family.
[ "Converts", "an", "address", "from", "its", "string", "representation", "to", "an", "IP", "address", "in", "a", "particular", "family", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L329-L338
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.familyOf
public static int familyOf(InetAddress address) { if (address instanceof Inet4Address) return IPv4; if (address instanceof Inet6Address) return IPv6; throw new IllegalArgumentException("unknown address family"); }
java
public static int familyOf(InetAddress address) { if (address instanceof Inet4Address) return IPv4; if (address instanceof Inet6Address) return IPv6; throw new IllegalArgumentException("unknown address family"); }
[ "public", "static", "int", "familyOf", "(", "InetAddress", "address", ")", "{", "if", "(", "address", "instanceof", "Inet4Address", ")", "return", "IPv4", ";", "if", "(", "address", "instanceof", "Inet6Address", ")", "return", "IPv6", ";", "throw", "new", "I...
Returns the family of an InetAddress. @param address The supplied address. @return The family, either IPv4 or IPv6.
[ "Returns", "the", "family", "of", "an", "InetAddress", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L363-L370
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/utils/base16.java
base16.fromString
public static byte [] fromString(String str) { ByteArrayOutputStream bs = new ByteArrayOutputStream(); byte [] raw = str.getBytes(); for (int i = 0; i < raw.length; i++) { if (!Character.isWhitespace((char)raw[i])) bs.write(raw[i]); } byte [] in = bs.toByteArray(); if (in.length % 2 != 0) { return null; }...
java
public static byte [] fromString(String str) { ByteArrayOutputStream bs = new ByteArrayOutputStream(); byte [] raw = str.getBytes(); for (int i = 0; i < raw.length; i++) { if (!Character.isWhitespace((char)raw[i])) bs.write(raw[i]); } byte [] in = bs.toByteArray(); if (in.length % 2 != 0) { return null; }...
[ "public", "static", "byte", "[", "]", "fromString", "(", "String", "str", ")", "{", "ByteArrayOutputStream", "bs", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "byte", "[", "]", "raw", "=", "str", ".", "getBytes", "(", ")", ";", "for", "(", "int...
Convert a hex-encoded String to binary data @param str A String containing the encoded data @return An array containing the binary data, or null if the string is invalid
[ "Convert", "a", "hex", "-", "encoded", "String", "to", "binary", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/utils/base16.java#L47-L73
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.put
public void put(Object o) throws InterruptedException { synchronized(lock) { while (size==maxSize) lock.wait(); elements[tail]=o; if(++tail==maxSize) tail=0; size++; lock.notify(); } }
java
public void put(Object o) throws InterruptedException { synchronized(lock) { while (size==maxSize) lock.wait(); elements[tail]=o; if(++tail==maxSize) tail=0; size++; lock.notify(); } }
[ "public", "void", "put", "(", "Object", "o", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "size", "==", "maxSize", ")", "lock", ".", "wait", "(", ")", ";", "elements", "[", "tail", "]", "=", "o", ";...
Put object in queue. @param o Object
[ "Put", "object", "in", "queue", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L86-L100
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.get
public Object get() throws InterruptedException { synchronized(lock) { while (size==0) lock.wait(); Object o = elements[head]; elements[head]=null; if(++head==maxSize) head=0; if (size==m...
java
public Object get() throws InterruptedException { synchronized(lock) { while (size==0) lock.wait(); Object o = elements[head]; elements[head]=null; if(++head==maxSize) head=0; if (size==m...
[ "public", "Object", "get", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "size", "==", "0", ")", "lock", ".", "wait", "(", ")", ";", "Object", "o", "=", "elements", "[", "head", "]", ";", "eleme...
Get object from queue. Block if there are no objects to get. @return The next object in the queue.
[ "Get", "object", "from", "queue", ".", "Block", "if", "there", "are", "no", "objects", "to", "get", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L133-L150
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.peek
public Object peek() throws InterruptedException { synchronized(lock) { if (size==0) lock.wait(); if (size==0) return null; Object o = elements[head]; return o; } }
java
public Object peek() throws InterruptedException { synchronized(lock) { if (size==0) lock.wait(); if (size==0) return null; Object o = elements[head]; return o; } }
[ "public", "Object", "peek", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "size", "==", "0", ")", "lock", ".", "wait", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "null", ";", "Ob...
Peek at the queue. Block if there are no objects to peek. @return The next object in the queue, or null if timedout.
[ "Peek", "at", "the", "queue", ".", "Block", "if", "there", "are", "no", "objects", "to", "peek", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L188-L202
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/JarFileResource.java
JarFileResource.exists
public boolean exists() { if (_exists) return true; if (_urlString.endsWith("!/")) { String file_url=_urlString.substring(4,_urlString.length()-2); try{return newResource(file_url).exists();} catch(Exception e) {LogSupport.ignore(log,e); retur...
java
public boolean exists() { if (_exists) return true; if (_urlString.endsWith("!/")) { String file_url=_urlString.substring(4,_urlString.length()-2); try{return newResource(file_url).exists();} catch(Exception e) {LogSupport.ignore(log,e); retur...
[ "public", "boolean", "exists", "(", ")", "{", "if", "(", "_exists", ")", "return", "true", ";", "if", "(", "_urlString", ".", "endsWith", "(", "\"!/\"", ")", ")", "{", "String", "file_url", "=", "_urlString", ".", "substring", "(", "4", ",", "_urlStrin...
Returns true if the respresenetd resource exists.
[ "Returns", "true", "if", "the", "respresenetd", "resource", "exists", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/JarFileResource.java#L103-L183
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.parse
public UserAgentInfo parse(String useragent) throws IOException { UserAgentInfo retObj = new UserAgentInfo(); if (useragent == null) { return retObj; } useragent = useragent.trim(); // check that the data maps are up-to-date checkDataMaps(); // first check if it's a robot if (!processRobot(userage...
java
public UserAgentInfo parse(String useragent) throws IOException { UserAgentInfo retObj = new UserAgentInfo(); if (useragent == null) { return retObj; } useragent = useragent.trim(); // check that the data maps are up-to-date checkDataMaps(); // first check if it's a robot if (!processRobot(userage...
[ "public", "UserAgentInfo", "parse", "(", "String", "useragent", ")", "throws", "IOException", "{", "UserAgentInfo", "retObj", "=", "new", "UserAgentInfo", "(", ")", ";", "if", "(", "useragent", "==", "null", ")", "{", "return", "retObj", ";", "}", "useragent...
Parse the given user agent string and returns a UserAgentInfo object with the related data @param useragent @throws IOException may happen when the retrieval of the data file fails @return
[ "Parse", "the", "given", "user", "agent", "string", "and", "returns", "a", "UserAgentInfo", "object", "with", "the", "related", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L77-L99
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processOsRegex
private void processOsRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); for (Map.Entry<Pattern, Long> entry : osRegMap.entrySet()) { Matcher matcher = entry.getKey().matcher(useragent); if (matcher.find()) { // simply ...
java
private void processOsRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); for (Map.Entry<Pattern, Long> entry : osRegMap.entrySet()) { Matcher matcher = entry.getKey().matcher(useragent); if (matcher.find()) { // simply ...
[ "private", "void", "processOsRegex", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Pattern", ",", "Long", ">", "entry", ":", "osRegMap", ".",...
Searches in the os regex table. if found a match copies the os data @param useragent @param retObj
[ "Searches", "in", "the", "os", "regex", "table", ".", "if", "found", "a", "match", "copies", "the", "os", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L107-L126
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processBrowserRegex
private boolean processBrowserRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); boolean osFound = false; for (Map.Entry<String, Long> entry : browserRegMap.entrySet()) { Pattern pattern = Pattern.compile(entry.getKey(), Pattern.CASE_INSENSITIV...
java
private boolean processBrowserRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); boolean osFound = false; for (Map.Entry<String, Long> entry : browserRegMap.entrySet()) { Pattern pattern = Pattern.compile(entry.getKey(), Pattern.CASE_INSENSITIV...
[ "private", "boolean", "processBrowserRegex", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "boolean", "osFound", "=", "false", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",...
Searchs in the browser regex table. if found a match copies the browser data and if possible os data @param useragent @param retObj @return
[ "Searchs", "in", "the", "browser", "regex", "table", ".", "if", "found", "a", "match", "copies", "the", "browser", "data", "and", "if", "possible", "os", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L135-L174
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.copyType
private void copyType(UserAgentInfo retObj, Long idBrowser) { try { lock.lock(); BrowserEntry be = browserMap.get(idBrowser); if (be != null) { Long type = be.getType(); if (type != null) { String typeString = browserTypeMa...
java
private void copyType(UserAgentInfo retObj, Long idBrowser) { try { lock.lock(); BrowserEntry be = browserMap.get(idBrowser); if (be != null) { Long type = be.getType(); if (type != null) { String typeString = browserTypeMa...
[ "private", "void", "copyType", "(", "UserAgentInfo", "retObj", ",", "Long", "idBrowser", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "BrowserEntry", "be", "=", "browserMap", ".", "get", "(", "idBrowser", ")", ";", "if", "(", "be", "!=", ...
Sets the source type, if possible @param retObj @param idBrowser
[ "Sets", "the", "source", "type", "if", "possible" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L182-L199
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processRobot
private boolean processRobot(String useragent, UserAgentInfo retObj) { try { lock.lock(); if (robotsMap.containsKey(useragent)) { retObj.setTyp("Robot"); RobotEntry robotEntry = robotsMap.get(useragent); robotEntry.copyTo(retObj); ...
java
private boolean processRobot(String useragent, UserAgentInfo retObj) { try { lock.lock(); if (robotsMap.containsKey(useragent)) { retObj.setTyp("Robot"); RobotEntry robotEntry = robotsMap.get(useragent); robotEntry.copyTo(retObj); ...
[ "private", "boolean", "processRobot", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "if", "(", "robotsMap", ".", "containsKey", "(", "useragent", ")", ")", "{", "retObj", ".", "setTy...
Checks if the useragent comes from a robot. if yes copies all the data to the result object @param useragent @param retObj @return true if the useragent belongs to a robot, else false
[ "Checks", "if", "the", "useragent", "comes", "from", "a", "robot", ".", "if", "yes", "copies", "all", "the", "data", "to", "the", "result", "object" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L208-L228
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java
TrustEverythingSSLTrustManager.getTrustingSSLSocketFactory
public synchronized static SSLSocketFactory getTrustingSSLSocketFactory() { if (socketFactory != null) return socketFactory; TrustManager[] trustManagers = new TrustManager[] { new TrustEverythingSSLTrustManager() }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); ...
java
public synchronized static SSLSocketFactory getTrustingSSLSocketFactory() { if (socketFactory != null) return socketFactory; TrustManager[] trustManagers = new TrustManager[] { new TrustEverythingSSLTrustManager() }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); ...
[ "public", "synchronized", "static", "SSLSocketFactory", "getTrustingSSLSocketFactory", "(", ")", "{", "if", "(", "socketFactory", "!=", "null", ")", "return", "socketFactory", ";", "TrustManager", "[", "]", "trustManagers", "=", "new", "TrustManager", "[", "]", "{...
Returns an SSLSocketFactory that will trust all SSL certificates; this is suitable for passing to HttpsURLConnection, either to its instance method setSSLSocketFactory, or to its static method setDefaultSSLSocketFactory. @see javax.net.ssl.HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory) @see javax.net.ssl.Http...
[ "Returns", "an", "SSLSocketFactory", "that", "will", "trust", "all", "SSL", "certificates", ";", "this", "is", "suitable", "for", "passing", "to", "HttpsURLConnection", "either", "to", "its", "instance", "method", "setSSLSocketFactory", "or", "to", "its", "static"...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java#L31-L43
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java
TrustEverythingSSLTrustManager.trustAllSSLCertificates
public static void trustAllSSLCertificates(HttpsURLConnection connection) { getTrustingSSLSocketFactory(); connection.setSSLSocketFactory(socketFactory); connection.setHostnameVerifier(new HostnameVerifier() { public boolean verify(String s, SSLSession sslSession) { r...
java
public static void trustAllSSLCertificates(HttpsURLConnection connection) { getTrustingSSLSocketFactory(); connection.setSSLSocketFactory(socketFactory); connection.setHostnameVerifier(new HostnameVerifier() { public boolean verify(String s, SSLSession sslSession) { r...
[ "public", "static", "void", "trustAllSSLCertificates", "(", "HttpsURLConnection", "connection", ")", "{", "getTrustingSSLSocketFactory", "(", ")", ";", "connection", ".", "setSSLSocketFactory", "(", "socketFactory", ")", ";", "connection", ".", "setHostnameVerifier", "(...
Configures a single HttpsURLConnection to trust all SSL certificates. @param connection an HttpsURLConnection which will be configured to trust all certs
[ "Configures", "a", "single", "HttpsURLConnection", "to", "trust", "all", "SSL", "certificates", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java#L58-L66
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java
KeyPairTool.doit
private void doit(String[] args) { try { // load parameters from the commandline loadParameters(args); // Try to load the private key importKeyPair(); } catch (Exception e) { System.out.println("Exception: " + e.get...
java
private void doit(String[] args) { try { // load parameters from the commandline loadParameters(args); // Try to load the private key importKeyPair(); } catch (Exception e) { System.out.println("Exception: " + e.get...
[ "private", "void", "doit", "(", "String", "[", "]", "args", ")", "{", "try", "{", "// load parameters from the commandline", "loadParameters", "(", "args", ")", ";", "// Try to load the private key", "importKeyPair", "(", ")", ";", "}", "catch", "(", "Exception", ...
Load parameters and perform the import command. Catch any exceptions and clear the password arrays. @param args String array containing command line arguments
[ "Load", "parameters", "and", "perform", "the", "import", "command", ".", "Catch", "any", "exceptions", "and", "clear", "the", "password", "arrays", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java#L92-L109
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java
KeyPairTool.loadPrivateKey
private PrivateKey loadPrivateKey(File privateKeyFile) throws Exception { // Load the key file. System.out.println("Loading private key from " + privateKeyFile + ", using " + providerClassName + " as the private key loading provider"); FileInputStream...
java
private PrivateKey loadPrivateKey(File privateKeyFile) throws Exception { // Load the key file. System.out.println("Loading private key from " + privateKeyFile + ", using " + providerClassName + " as the private key loading provider"); FileInputStream...
[ "private", "PrivateKey", "loadPrivateKey", "(", "File", "privateKeyFile", ")", "throws", "Exception", "{", "// Load the key file.", "System", ".", "out", ".", "println", "(", "\"Loading private key from \"", "+", "privateKeyFile", "+", "\", using \"", "+", "providerClas...
Load an RSA private key from the given File @param privateKeyFile String name of file to load the key from @return PrivateKey loaded from the file @throws Exception if there are problems with loading the key.
[ "Load", "an", "RSA", "private", "key", "from", "the", "given", "File" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java#L225-L269
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java
NCSARequestLog.setFilename
public void setFilename(String filename) { if (filename!=null) { filename=filename.trim(); if (filename.length()==0) filename=null; } _filename=filename; }
java
public void setFilename(String filename) { if (filename!=null) { filename=filename.trim(); if (filename.length()==0) filename=null; } _filename=filename; }
[ "public", "void", "setFilename", "(", "String", "filename", ")", "{", "if", "(", "filename", "!=", "null", ")", "{", "filename", "=", "filename", ".", "trim", "(", ")", ";", "if", "(", "filename", ".", "length", "(", ")", "==", "0", ")", "filename", ...
Set the log filename. @see NCSARequestLog#setRetainDays(int) @param filename The filename to use. If the filename contains the string "yyyy_mm_dd", then a RolloverFileOutputStream is used and the log is rolled over nightly and aged according setRetainDays. If no filename is set or a null filename passed, then requests ...
[ "Set", "the", "log", "filename", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java#L99-L108
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java
NCSARequestLog.logExtended
protected void logExtended(HttpRequest request, HttpResponse response, Writer log) throws IOException { String referer = request.getField(HttpFields.__Referer); if(referer==null) log.write("\"-\" "); else ...
java
protected void logExtended(HttpRequest request, HttpResponse response, Writer log) throws IOException { String referer = request.getField(HttpFields.__Referer); if(referer==null) log.write("\"-\" "); else ...
[ "protected", "void", "logExtended", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ",", "Writer", "log", ")", "throws", "IOException", "{", "String", "referer", "=", "request", ".", "getField", "(", "HttpFields", ".", "__Referer", ")", ";", "i...
Log Extended fields. This method can be extended by a derived class to add extened fields to each log entry. It is called by the log method after all standard fields have been added, but before the line terminator. Derived implementations should write extra fields to the Writer provided. The default implementation wri...
[ "Log", "Extended", "fields", ".", "This", "method", "can", "be", "extended", "by", "a", "derived", "class", "to", "add", "extened", "fields", "to", "each", "log", "entry", ".", "It", "is", "called", "by", "the", "log", "method", "after", "all", "standard...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java#L472-L498
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.setHeaderValue
public void setHeaderValue(String name,String value) { _fields.put(name,Collections.singletonList(value)); }
java
public void setHeaderValue(String name,String value) { _fields.put(name,Collections.singletonList(value)); }
[ "public", "void", "setHeaderValue", "(", "String", "name", ",", "String", "value", ")", "{", "_fields", ".", "put", "(", "name", ",", "Collections", ".", "singletonList", "(", "value", ")", ")", ";", "}" ]
Set a header override, every response handled will have this header set. @param name The String name of the header. @param value The String value of the header.
[ "Set", "a", "header", "override", "every", "response", "handled", "will", "have", "this", "header", "set", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L50-L53
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.setHeaderValues
public void setHeaderValues(String name,String[] values) { _fields.put(name,Arrays.asList(values)); }
java
public void setHeaderValues(String name,String[] values) { _fields.put(name,Arrays.asList(values)); }
[ "public", "void", "setHeaderValues", "(", "String", "name", ",", "String", "[", "]", "values", ")", "{", "_fields", ".", "put", "(", "name", ",", "Arrays", ".", "asList", "(", "values", ")", ")", ";", "}" ]
Set a multivalued header, every response handled will have this header set with the provided values. @param name The String name of the header. @param values An Array of String values to use as the values for a Header.
[ "Set", "a", "multivalued", "header", "every", "response", "handled", "will", "have", "this", "header", "set", "with", "the", "provided", "values", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L62-L65
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.handle
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException,IOException { log.debug("SetResponseHeadersHandler.handle()"); for (Iterator iterator=_fields...
java
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException,IOException { log.debug("SetResponseHeadersHandler.handle()"); for (Iterator iterator=_fields...
[ "public", "void", "handle", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "HttpException", ",", "IOException", "{", "log", ".", "debug", "(", "\"SetResponseHeadersHandler.h...
Handle a request by pre-populating the headers from the configured set of _fields. Settings made here can be overridden by subsequent handling of the request. @param pathInContext The context path. Ignored. @param pathParams Path parameters such as encoded Session ID. Ignored. @param request The HttpRequest request. ...
[ "Handle", "a", "request", "by", "pre", "-", "populating", "the", "headers", "from", "the", "configured", "set", "of", "_fields", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L79-L94
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java
TrustingSSLSocketFactory.createSimulatedSocket
private Socket createSimulatedSocket(SSLSocket socket) { SimulatedSocketFactory.configure(socket); socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } ); //socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" }); return new ...
java
private Socket createSimulatedSocket(SSLSocket socket) { SimulatedSocketFactory.configure(socket); socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } ); //socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" }); return new ...
[ "private", "Socket", "createSimulatedSocket", "(", "SSLSocket", "socket", ")", "{", "SimulatedSocketFactory", ".", "configure", "(", "socket", ")", ";", "socket", ".", "setEnabledProtocols", "(", "new", "String", "[", "]", "{", "SSLAlgorithm", ".", "SSLv3", ".",...
just an helper function to wrap a normal sslSocket into a simulated one so we can do throttling
[ "just", "an", "helper", "function", "to", "wrap", "a", "normal", "sslSocket", "into", "a", "simulated", "one", "so", "we", "can", "do", "throttling" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java#L74-L79
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.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", ")", "{", ...
This implementation uses a local properties file to keep the lastUpdate time and the local data file version
[ "This", "implementation", "uses", "a", "local", "properties", "file", "to", "keep", "the", "lastUpdate", "time", "and", "the", "local", "data", "file", "version" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L68-L82
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.loadDataFromInternetAndSave
private void loadDataFromInternetAndSave() throws IOException { InputStream is = null; FileOutputStream fos = null; try { URL url = new URL(DATA_RETRIVE_URL); is = url.openStream(); fos = new FileOutputStream(getCacheFile()); byte[] buff = new byte[1024 * 8]; int len = 0; while ((len = is.read(b...
java
private void loadDataFromInternetAndSave() throws IOException { InputStream is = null; FileOutputStream fos = null; try { URL url = new URL(DATA_RETRIVE_URL); is = url.openStream(); fos = new FileOutputStream(getCacheFile()); byte[] buff = new byte[1024 * 8]; int len = 0; while ((len = is.read(b...
[ "private", "void", "loadDataFromInternetAndSave", "(", ")", "throws", "IOException", "{", "InputStream", "is", "=", "null", ";", "FileOutputStream", "fos", "=", "null", ";", "try", "{", "URL", "url", "=", "new", "URL", "(", "DATA_RETRIVE_URL", ")", ";", "is"...
loads the data file from the server and saves it to the local file system @throws IOException
[ "loads", "the", "data", "file", "from", "the", "server", "and", "saves", "it", "to", "the", "local", "file", "system" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L97-L118
train
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.saveProperties
private void saveProperties(Properties prop) throws FileNotFoundException, IOException { FileOutputStream fos = new FileOutputStream(getPropertiesFile()); try { prop.store(fos, null); } finally { fos.close(); } }
java
private void saveProperties(Properties prop) throws FileNotFoundException, IOException { FileOutputStream fos = new FileOutputStream(getPropertiesFile()); try { prop.store(fos, null); } finally { fos.close(); } }
[ "private", "void", "saveProperties", "(", "Properties", "prop", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "getPropertiesFile", "(", ")", ")", ";", "try", "{", "prop", ".", "st...
Saves the properties file to the local filesystem @param prop @throws FileNotFoundException @throws IOException
[ "Saves", "the", "properties", "file", "to", "the", "local", "filesystem" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L127-L134
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java
ThreadedServer.setInetAddrPort
public synchronized void setInetAddrPort(InetAddrPort address) { if (_address != null && _address.equals(address)) return; if (isStarted()) log.warn(this + " is started"); _address = address; }
java
public synchronized void setInetAddrPort(InetAddrPort address) { if (_address != null && _address.equals(address)) return; if (isStarted()) log.warn(this + " is started"); _address = address; }
[ "public", "synchronized", "void", "setInetAddrPort", "(", "InetAddrPort", "address", ")", "{", "if", "(", "_address", "!=", "null", "&&", "_address", ".", "equals", "(", "address", ")", ")", "return", ";", "if", "(", "isStarted", "(", ")", ")", "log", "....
Set the server InetAddress and port. @param address The Address to listen on, or 0.0.0.0:port for all interfaces.
[ "Set", "the", "server", "InetAddress", "and", "port", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L119-L126
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java
ThreadedServer.open
public void open() throws IOException { if (_listen == null) { _listen = newServerSocket(_address, _acceptQueueSize); if (_address == null) _address = new InetAddrPort(_listen.getInetAddress(), _listen.getLocalPort()); else { ...
java
public void open() throws IOException { if (_listen == null) { _listen = newServerSocket(_address, _acceptQueueSize); if (_address == null) _address = new InetAddrPort(_listen.getInetAddress(), _listen.getLocalPort()); else { ...
[ "public", "void", "open", "(", ")", "throws", "IOException", "{", "if", "(", "_listen", "==", "null", ")", "{", "_listen", "=", "newServerSocket", "(", "_address", ",", "_acceptQueueSize", ")", ";", "if", "(", "_address", "==", "null", ")", "_address", "...
Open the server socket. This method can be called to open the server socket in advance of starting the listener. This can be used to test if the port is available. @exception IOException if an error occurs
[ "Open", "the", "server", "socket", ".", "This", "method", "can", "be", "called", "to", "open", "the", "server", "socket", "in", "advance", "of", "starting", "the", "listener", ".", "This", "can", "be", "used", "to", "test", "if", "the", "port", "is", "...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L473-L491
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java
ThreadedServer.stopJob
protected void stopJob(Thread thread, Object job) { if (job instanceof Socket) { try { ((Socket) job).close(); } catch (Exception e) { LogSupport.ignore(log, e); } } super.stopJob(...
java
protected void stopJob(Thread thread, Object job) { if (job instanceof Socket) { try { ((Socket) job).close(); } catch (Exception e) { LogSupport.ignore(log, e); } } super.stopJob(...
[ "protected", "void", "stopJob", "(", "Thread", "thread", ",", "Object", "job", ")", "{", "if", "(", "job", "instanceof", "Socket", ")", "{", "try", "{", "(", "(", "Socket", ")", "job", ")", ".", "close", "(", ")", ";", "}", "catch", "(", "Exception...
Kill a job. This method closes IDLE and socket associated with a job @param thread @param job
[ "Kill", "a", "job", ".", "This", "method", "closes", "IDLE", "and", "socket", "associated", "with", "a", "job" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L591-L605
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java
MultiMap.getValue
public Object getValue(Object name,int i) { Object l=super.get(name); if (i==0 && LazyList.size(l)==0) return null; return LazyList.get(l,i); }
java
public Object getValue(Object name,int i) { Object l=super.get(name); if (i==0 && LazyList.size(l)==0) return null; return LazyList.get(l,i); }
[ "public", "Object", "getValue", "(", "Object", "name", ",", "int", "i", ")", "{", "Object", "l", "=", "super", ".", "get", "(", "name", ")", ";", "if", "(", "i", "==", "0", "&&", "LazyList", ".", "size", "(", "l", ")", "==", "0", ")", "return",...
Get a value from a multiple value. If the value is not a multivalue, then index 0 retrieves the value or null. @param name The entry key. @param i Index of element to get. @return Unmodifieable List of values.
[ "Get", "a", "value", "from", "a", "multiple", "value", ".", "If", "the", "value", "is", "not", "a", "multivalue", "then", "index", "0", "retrieves", "the", "value", "or", "null", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java#L77-L83
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java
MultiMap.put
public Object put(Object name, Object value) { return super.put(name,LazyList.add(null,value)); }
java
public Object put(Object name, Object value) { return super.put(name,LazyList.add(null,value)); }
[ "public", "Object", "put", "(", "Object", "name", ",", "Object", "value", ")", "{", "return", "super", ".", "put", "(", "name", ",", "LazyList", ".", "add", "(", "null", ",", "value", ")", ")", ";", "}" ]
Put and entry into the map. @param name The entry key. @param value The entry value. @return The previous value or null.
[ "Put", "and", "entry", "into", "the", "map", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java#L145-L148
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java
MultiMap.putAll
public void putAll(Map m) { Iterator i = m.entrySet().iterator(); boolean multi=m instanceof MultiMap; while(i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); if (multi) super.put(entry.getKey(),LazyList.clone(entry.getValue...
java
public void putAll(Map m) { Iterator i = m.entrySet().iterator(); boolean multi=m instanceof MultiMap; while(i.hasNext()) { Map.Entry entry = (Map.Entry)i.next(); if (multi) super.put(entry.getKey(),LazyList.clone(entry.getValue...
[ "public", "void", "putAll", "(", "Map", "m", ")", "{", "Iterator", "i", "=", "m", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "boolean", "multi", "=", "m", "instanceof", "MultiMap", ";", "while", "(", "i", ".", "hasNext", "(", ")", ...
Put all contents of map. @param m Map
[ "Put", "all", "contents", "of", "map", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/MultiMap.java#L247-L260
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/DSASignature.java
DSASignature.fromDNS
public static byte [] fromDNS(byte [] sig) { final int len = 20; int n = 0; byte rlen, slen, seqlen; rlen = len; if (sig[1] < 0) rlen++; slen = len; if (sig[len + 1] < 0) slen++; /* 4 = 2 * (INT, value) */ seqlen = (byte) (rlen + slen + 4); /* 2 = 1 * (SEQ, value) */ byte [] array = new byte[seqlen +...
java
public static byte [] fromDNS(byte [] sig) { final int len = 20; int n = 0; byte rlen, slen, seqlen; rlen = len; if (sig[1] < 0) rlen++; slen = len; if (sig[len + 1] < 0) slen++; /* 4 = 2 * (INT, value) */ seqlen = (byte) (rlen + slen + 4); /* 2 = 1 * (SEQ, value) */ byte [] array = new byte[seqlen +...
[ "public", "static", "byte", "[", "]", "fromDNS", "(", "byte", "[", "]", "sig", ")", "{", "final", "int", "len", "=", "20", ";", "int", "n", "=", "0", ";", "byte", "rlen", ",", "slen", ",", "seqlen", ";", "rlen", "=", "len", ";", "if", "(", "s...
Converts the signature field in a SIG record to the format expected by the DSA verification routines.
[ "Converts", "the", "signature", "field", "in", "a", "SIG", "record", "to", "the", "format", "expected", "by", "the", "DSA", "verification", "routines", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/DSASignature.java#L27-L62
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java
HttpOutputStream.setBufferSize
public void setBufferSize(int size) throws IllegalStateException { if (size<=_bufferSize) return; if (_bufferedOut!=null && _bufferedOut.size()>0) throw new IllegalStateException("Not Reset"); try { _bufferSize=size; i...
java
public void setBufferSize(int size) throws IllegalStateException { if (size<=_bufferSize) return; if (_bufferedOut!=null && _bufferedOut.size()>0) throw new IllegalStateException("Not Reset"); try { _bufferSize=size; i...
[ "public", "void", "setBufferSize", "(", "int", "size", ")", "throws", "IllegalStateException", "{", "if", "(", "size", "<=", "_bufferSize", ")", "return", ";", "if", "(", "_bufferedOut", "!=", "null", "&&", "_bufferedOut", ".", "size", "(", ")", ">", "0", ...
Set the output buffer size. Note that this is the minimal buffer size and that installed filters may perform their own buffering and are likely to change the size of the output. Also the pre and post reserve buffers may be allocated within the buffer for headers and chunking. @param size Minimum buffer size in bytes @e...
[ "Set", "the", "output", "buffer", "size", ".", "Note", "that", "this", "is", "the", "minimal", "buffer", "size", "and", "that", "installed", "filters", "may", "perform", "their", "own", "buffering", "and", "are", "likely", "to", "change", "the", "size", "o...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java#L167-L189
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java
HttpOutputStream.resetBuffer
public void resetBuffer() throws IllegalStateException { // Shutdown filters without observation if (_out!=null && _out!=_realOut) { ArrayList save_observers=_observers; _observers=null; _nulled=true; try { ...
java
public void resetBuffer() throws IllegalStateException { // Shutdown filters without observation if (_out!=null && _out!=_realOut) { ArrayList save_observers=_observers; _observers=null; _nulled=true; try { ...
[ "public", "void", "resetBuffer", "(", ")", "throws", "IllegalStateException", "{", "// Shutdown filters without observation", "if", "(", "_out", "!=", "null", "&&", "_out", "!=", "_realOut", ")", "{", "ArrayList", "save_observers", "=", "_observers", ";", "_observer...
Reset Buffered output. If no data has been committed, the buffer output is discarded and the filters may be reinitialized. @exception IllegalStateException
[ "Reset", "Buffered", "output", ".", "If", "no", "data", "has", "been", "committed", "the", "buffer", "output", "is", "discarded", "and", "the", "filters", "may", "be", "reinitialized", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java#L203-L245
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java
HttpOutputStream.setChunking
public void setChunking() { checkOutput(); if (_bufferedOut instanceof ChunkingOutputStream) ((ChunkingOutputStream)_bufferedOut).setChunking(true); else throw new IllegalStateException(_bufferedOut.getClass().toString()); }
java
public void setChunking() { checkOutput(); if (_bufferedOut instanceof ChunkingOutputStream) ((ChunkingOutputStream)_bufferedOut).setChunking(true); else throw new IllegalStateException(_bufferedOut.getClass().toString()); }
[ "public", "void", "setChunking", "(", ")", "{", "checkOutput", "(", ")", ";", "if", "(", "_bufferedOut", "instanceof", "ChunkingOutputStream", ")", "(", "(", "ChunkingOutputStream", ")", "_bufferedOut", ")", ".", "setChunking", "(", "true", ")", ";", "else", ...
Set chunking mode.
[ "Set", "chunking", "mode", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java#L311-L318
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java
HttpOutputStream.resetStream
public void resetStream() throws IOException, IllegalStateException { if (isChunking()) close(); _out=null; _nulled=true; if (_bufferedOut!=null) { _bufferedOut.resetStream(); if (_bufferedOut instanceof ChunkingOutputStrea...
java
public void resetStream() throws IOException, IllegalStateException { if (isChunking()) close(); _out=null; _nulled=true; if (_bufferedOut!=null) { _bufferedOut.resetStream(); if (_bufferedOut instanceof ChunkingOutputStrea...
[ "public", "void", "resetStream", "(", ")", "throws", "IOException", ",", "IllegalStateException", "{", "if", "(", "isChunking", "(", ")", ")", "close", "(", ")", ";", "_out", "=", "null", ";", "_nulled", "=", "true", ";", "if", "(", "_bufferedOut", "!=",...
Reset the stream. Turn disable all filters. @exception IllegalStateException The stream cannot be reset if chunking is enabled.
[ "Reset", "the", "stream", ".", "Turn", "disable", "all", "filters", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpOutputStream.java#L335-L365
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java
IPAccessHandler.handle
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { // exempt error pages // TODO This probably should be more general? if (request.getAttribute("javax.servlet.error.status_code") != null) re...
java
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException, IOException { // exempt error pages // TODO This probably should be more general? if (request.getAttribute("javax.servlet.error.status_code") != null) re...
[ "public", "void", "handle", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "HttpException", ",", "IOException", "{", "// exempt error pages", "// TODO This probably should be more...
Handles the incoming request @param pathInContext @param pathParams @param request The incoming HTTP-request @param response The outgoing HTTP-response
[ "Handles", "the", "incoming", "request" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java#L89-L122
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java
IPAccessHandler.setStandard
public void setStandard(String s) { s = s.toLowerCase(); if (s.indexOf("allow") > -1) { standard = true; } else { standard = false; } }
java
public void setStandard(String s) { s = s.toLowerCase(); if (s.indexOf("allow") > -1) { standard = true; } else { standard = false; } }
[ "public", "void", "setStandard", "(", "String", "s", ")", "{", "s", "=", "s", ".", "toLowerCase", "(", ")", ";", "if", "(", "s", ".", "indexOf", "(", "\"allow\"", ")", ">", "-", "1", ")", "{", "standard", "=", "true", ";", "}", "else", "{", "st...
Set the standard action beeing taken when not registred IPs wants access @param s The standard-string (either 'allow' or 'deny')
[ "Set", "the", "standard", "action", "beeing", "taken", "when", "not", "registred", "IPs", "wants", "access" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java#L149-L160
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java
IPAccessHandler.main
private static void main(String[] args) { IPAccessHandler ipah = new IPAccessHandler(); ipah.setStandard("deny"); ipah.setAllowIP("217.215.71.167"); ipah.setDenyIP("217.215.71.149"); System.out.println(ipah.checkIP("217.215.71.245") + " = false"); System.out.println(i...
java
private static void main(String[] args) { IPAccessHandler ipah = new IPAccessHandler(); ipah.setStandard("deny"); ipah.setAllowIP("217.215.71.167"); ipah.setDenyIP("217.215.71.149"); System.out.println(ipah.checkIP("217.215.71.245") + " = false"); System.out.println(i...
[ "private", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "IPAccessHandler", "ipah", "=", "new", "IPAccessHandler", "(", ")", ";", "ipah", ".", "setStandard", "(", "\"deny\"", ")", ";", "ipah", ".", "setAllowIP", "(", "\"217.215.71.16...
Main method for testing & debugging.
[ "Main", "method", "for", "testing", "&", "debugging", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/IPAccessHandler.java#L166-L185
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpRequest.java
ServletHttpRequest.setServletPaths
void setServletPaths(String servletPath, String pathInfo, ServletHolder holder) { _servletPath=servletPath; _pathInfo=pathInfo; _servletHolder=holder; }
java
void setServletPaths(String servletPath, String pathInfo, ServletHolder holder) { _servletPath=servletPath; _pathInfo=pathInfo; _servletHolder=holder; }
[ "void", "setServletPaths", "(", "String", "servletPath", ",", "String", "pathInfo", ",", "ServletHolder", "holder", ")", "{", "_servletPath", "=", "servletPath", ";", "_pathInfo", "=", "pathInfo", ";", "_servletHolder", "=", "holder", ";", "}" ]
Set servletpath and pathInfo. Called by the Handler before passing a request to a particular holder to split the context path into a servlet path and path info. @param servletPath @param pathInfo
[ "Set", "servletpath", "and", "pathInfo", ".", "Called", "by", "the", "Handler", "before", "passing", "a", "request", "to", "a", "particular", "holder", "to", "split", "the", "context", "path", "into", "a", "servlet", "path", "and", "path", "info", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpRequest.java#L145-L152
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpRequest.java
ServletHttpRequest.unwrap
public static ServletHttpRequest unwrap(ServletRequest request) { while (!(request instanceof ServletHttpRequest)) { if (request instanceof ServletRequestWrapper) { ServletRequestWrapper wrapper = (ServletRequestWrapper)request; ...
java
public static ServletHttpRequest unwrap(ServletRequest request) { while (!(request instanceof ServletHttpRequest)) { if (request instanceof ServletRequestWrapper) { ServletRequestWrapper wrapper = (ServletRequestWrapper)request; ...
[ "public", "static", "ServletHttpRequest", "unwrap", "(", "ServletRequest", "request", ")", "{", "while", "(", "!", "(", "request", "instanceof", "ServletHttpRequest", ")", ")", "{", "if", "(", "request", "instanceof", "ServletRequestWrapper", ")", "{", "ServletReq...
Unwrap a ServletRequest. @see javax.servlet.ServletRequestWrapper @see javax.servlet.http.HttpServletRequestWrapper @param request @return The core ServletHttpRequest which must be the underlying request object
[ "Unwrap", "a", "ServletRequest", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpRequest.java#L802-L817
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getTimeStampStr
public String getTimeStampStr() { if (_timeStampStr == null && _timeStamp > 0) _timeStampStr = HttpFields.__dateCache.format(_timeStamp); return _timeStampStr; }
java
public String getTimeStampStr() { if (_timeStampStr == null && _timeStamp > 0) _timeStampStr = HttpFields.__dateCache.format(_timeStamp); return _timeStampStr; }
[ "public", "String", "getTimeStampStr", "(", ")", "{", "if", "(", "_timeStampStr", "==", "null", "&&", "_timeStamp", ">", "0", ")", "_timeStampStr", "=", "HttpFields", ".", "__dateCache", ".", "format", "(", "_timeStamp", ")", ";", "return", "_timeStampStr", ...
Get Request TimeStamp @return The time that the request was received.
[ "Get", "Request", "TimeStamp" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L134-L139
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.isHandled
public boolean isHandled() { if (_handled) return true; HttpResponse response = getHttpResponse(); return (response != null && response.getState() != HttpMessage.__MSG_EDITABLE); }
java
public boolean isHandled() { if (_handled) return true; HttpResponse response = getHttpResponse(); return (response != null && response.getState() != HttpMessage.__MSG_EDITABLE); }
[ "public", "boolean", "isHandled", "(", ")", "{", "if", "(", "_handled", ")", "return", "true", ";", "HttpResponse", "response", "=", "getHttpResponse", "(", ")", ";", "return", "(", "response", "!=", "null", "&&", "response", ".", "getState", "(", ")", "...
Is the request handled. @return True if the request has been set to handled or the associated response is not editable.
[ "Is", "the", "request", "handled", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L186-L192
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.readHeader
public void readHeader(LineInput in) throws IOException { _state = __MSG_BAD; // Get start line org.browsermob.proxy.jetty.util.LineInput.LineBuffer line_buffer; do { line_buffer = in.readLineBuffer(); if (line_buffer == null) throw new EOFException(...
java
public void readHeader(LineInput in) throws IOException { _state = __MSG_BAD; // Get start line org.browsermob.proxy.jetty.util.LineInput.LineBuffer line_buffer; do { line_buffer = in.readLineBuffer(); if (line_buffer == null) throw new EOFException(...
[ "public", "void", "readHeader", "(", "LineInput", "in", ")", "throws", "IOException", "{", "_state", "=", "__MSG_BAD", ";", "// Get start line", "org", ".", "browsermob", ".", "proxy", ".", "jetty", ".", "util", ".", "LineInput", ".", "LineBuffer", "line_buffe...
Read the request line and header. @param in @exception IOException
[ "Read", "the", "request", "line", "and", "header", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L212-L254
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.writeRequestLine
public void writeRequestLine(Writer writer) throws IOException { writer.write(_method); writer.write(' '); writer.write(_uri != null ? _uri.toString() : "null"); writer.write(' '); writer.write(_version); }
java
public void writeRequestLine(Writer writer) throws IOException { writer.write(_method); writer.write(' '); writer.write(_uri != null ? _uri.toString() : "null"); writer.write(' '); writer.write(_version); }
[ "public", "void", "writeRequestLine", "(", "Writer", "writer", ")", "throws", "IOException", "{", "writer", ".", "write", "(", "_method", ")", ";", "writer", ".", "write", "(", "'", "'", ")", ";", "writer", ".", "write", "(", "_uri", "!=", "null", "?",...
Write the HTTP request line as it was received.
[ "Write", "the", "HTTP", "request", "line", "as", "it", "was", "received", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L260-L267
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getScheme
public String getScheme() { String scheme = _uri.getScheme(); if (scheme == null && _connection != null) scheme = _connection.getDefaultScheme(); return scheme == null ? "http" : scheme; }
java
public String getScheme() { String scheme = _uri.getScheme(); if (scheme == null && _connection != null) scheme = _connection.getDefaultScheme(); return scheme == null ? "http" : scheme; }
[ "public", "String", "getScheme", "(", ")", "{", "String", "scheme", "=", "_uri", ".", "getScheme", "(", ")", ";", "if", "(", "scheme", "==", "null", "&&", "_connection", "!=", "null", ")", "scheme", "=", "_connection", ".", "getDefaultScheme", "(", ")", ...
Get the request Scheme. The scheme is obtained from an absolute URI. If the URI in the request is not absolute, then the connections default scheme is returned. If there is no connection "http" is returned. @return The request scheme (eg. "http", "https", etc.)
[ "Get", "the", "request", "Scheme", ".", "The", "scheme", "is", "obtained", "from", "an", "absolute", "URI", ".", "If", "the", "URI", "in", "the", "request", "is", "not", "absolute", "then", "the", "connections", "default", "scheme", "is", "returned", ".", ...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L403-L408
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getHost
public String getHost() { // Return already determined host if (_host != null) return _host; // Return host from absolute URI _host = _uri.getHost(); _port = _uri.getPort(); if (_host != null) return _host; // Return host from header field _hostPort ...
java
public String getHost() { // Return already determined host if (_host != null) return _host; // Return host from absolute URI _host = _uri.getHost(); _port = _uri.getPort(); if (_host != null) return _host; // Return host from header field _hostPort ...
[ "public", "String", "getHost", "(", ")", "{", "// Return already determined host", "if", "(", "_host", "!=", "null", ")", "return", "_host", ";", "// Return host from absolute URI", "_host", "=", "_uri", ".", "getHost", "(", ")", ";", "_port", "=", "_uri", "."...
Get the request host. @return The host name obtained from an absolute URI, the HTTP header field, the requests connection or the local host name.
[ "Get", "the", "request", "host", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L435-L489
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getPort
public int getPort() { if (_port > 0) return _port; if (_host != null) return 0; if (_uri.isAbsolute()) _port = _uri.getPort(); else if (_connection != null) _port = _connection.getServerPort(); return _port; }
java
public int getPort() { if (_port > 0) return _port; if (_host != null) return 0; if (_uri.isAbsolute()) _port = _uri.getPort(); else if (_connection != null) _port = _connection.getServerPort(); return _port; }
[ "public", "int", "getPort", "(", ")", "{", "if", "(", "_port", ">", "0", ")", "return", "_port", ";", "if", "(", "_host", "!=", "null", ")", "return", "0", ";", "if", "(", "_uri", ".", "isAbsolute", "(", ")", ")", "_port", "=", "_uri", ".", "ge...
Get the request port. The port is obtained either from an absolute URI, the HTTP Host header field, the connection or the default. @return The port. 0 should be interpreted as the default port.
[ "Get", "the", "request", "port", ".", "The", "port", "is", "obtained", "either", "from", "an", "absolute", "URI", "the", "HTTP", "Host", "header", "field", "the", "connection", "or", "the", "default", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L498-L506
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.forceRemoveField
Object forceRemoveField(String name) { int saved_state = _state; try { _state = __MSG_EDITABLE; return removeField(name); } finally { _state = saved_state; } }
java
Object forceRemoveField(String name) { int saved_state = _state; try { _state = __MSG_EDITABLE; return removeField(name); } finally { _state = saved_state; } }
[ "Object", "forceRemoveField", "(", "String", "name", ")", "{", "int", "saved_state", "=", "_state", ";", "try", "{", "_state", "=", "__MSG_EDITABLE", ";", "return", "removeField", "(", "name", ")", ";", "}", "finally", "{", "_state", "=", "saved_state", ";...
Force a removeField. This call ignores the message state and forces a field to be removed from the request. It is required for the handling of the Connection field. @param name The field name @return The old value or null.
[ "Force", "a", "removeField", ".", "This", "call", "ignores", "the", "message", "state", "and", "forces", "a", "field", "to", "be", "removed", "from", "the", "request", ".", "It", "is", "required", "for", "the", "handling", "of", "the", "Connection", "field...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L742-L754
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getAcceptableTransferCodings
public List getAcceptableTransferCodings() { if (_dotVersion < 1) return null; if (_te != null) return _te; // Decode any TE field Enumeration tenum = getFieldValues(HttpFields.__TE, HttpFields.__separators); if (tenum != null) { // Sort the list ...
java
public List getAcceptableTransferCodings() { if (_dotVersion < 1) return null; if (_te != null) return _te; // Decode any TE field Enumeration tenum = getFieldValues(HttpFields.__TE, HttpFields.__separators); if (tenum != null) { // Sort the list ...
[ "public", "List", "getAcceptableTransferCodings", "(", ")", "{", "if", "(", "_dotVersion", "<", "1", ")", "return", "null", ";", "if", "(", "_te", "!=", "null", ")", "return", "_te", ";", "// Decode any TE field", "Enumeration", "tenum", "=", "getFieldValues",...
Get the acceptable transfer encodings. The TE field is used to construct a list of acceptable extension transfer codings in quality order. An empty list implies that only "chunked" is acceptable. A null list implies that no transfer coding can be applied. If the "trailer" coding is found in the TE field, then message ...
[ "Get", "the", "acceptable", "transfer", "encodings", ".", "The", "TE", "field", "is", "used", "to", "construct", "a", "list", "of", "acceptable", "extension", "transfer", "codings", "in", "quality", "order", ".", "An", "empty", "list", "implies", "that", "on...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L767-L807
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.getParameter
public String getParameter(String name) { if (!_paramsExtracted) extractParameters(); return (String) _parameters.getValue(name, 0); }
java
public String getParameter(String name) { if (!_paramsExtracted) extractParameters(); return (String) _parameters.getValue(name, 0); }
[ "public", "String", "getParameter", "(", "String", "name", ")", "{", "if", "(", "!", "_paramsExtracted", ")", "extractParameters", "(", ")", ";", "return", "(", "String", ")", "_parameters", ".", "getValue", "(", "name", ",", "0", ")", ";", "}" ]
Get a parameter value. @param name Parameter name @return Parameter value
[ "Get", "a", "parameter", "value", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L923-L927
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.recycle
void recycle(HttpConnection connection) { _method = null; //_uri=null; _host = null; _hostPort = null; _port = 0; _te = null; if (_parameters != null) _parameters.clear(); _paramsExtracted = false; _handled = false; _cookiesExtracted = ...
java
void recycle(HttpConnection connection) { _method = null; //_uri=null; _host = null; _hostPort = null; _port = 0; _te = null; if (_parameters != null) _parameters.clear(); _paramsExtracted = false; _handled = false; _cookiesExtracted = ...
[ "void", "recycle", "(", "HttpConnection", "connection", ")", "{", "_method", "=", "null", ";", "//_uri=null;", "_host", "=", "null", ";", "_hostPort", "=", "null", ";", "_port", "=", "0", ";", "_te", "=", "null", ";", "if", "(", "_parameters", "!=", "n...
Recycle the request.
[ "Recycle", "the", "request", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java#L1173-L1191
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpRequest.java
HttpRequest.destroy
public void destroy() { _parameters = null; _method = null; _uri = null; _host = null; _hostPort = null; _te = null; _cookies = null; _lastCookies = null; _timeStampStr = null; _userPrincipal = null; _authUser = null; _a...
java
public void destroy() { _parameters = null; _method = null; _uri = null; _host = null; _hostPort = null; _te = null; _cookies = null; _lastCookies = null; _timeStampStr = null; _userPrincipal = null; _authUser = null; _a...
[ "public", "void", "destroy", "(", ")", "{", "_parameters", "=", "null", ";", "_method", "=", "null", ";", "_uri", "=", "null", ";", "_host", "=", "null", ";", "_hostPort", "=", "null", ";", "_te", "=", "null", ";", "_cookies", "=", "null", ";", "_l...
Destroy the request. Help the garbage collector by null everything that we can.
[ "Destroy", "the", "request", ".", "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/HttpRequest.java#L1197-L1213
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/InetAddrPort.java
InetAddrPort.getHost
public String getHost() { if (_addr==null) return __0_0_0_0; return _addrIsHost?_addr.getHostName():_addr.getHostAddress(); }
java
public String getHost() { if (_addr==null) return __0_0_0_0; return _addrIsHost?_addr.getHostName():_addr.getHostAddress(); }
[ "public", "String", "getHost", "(", ")", "{", "if", "(", "_addr", "==", "null", ")", "return", "__0_0_0_0", ";", "return", "_addrIsHost", "?", "_addr", ".", "getHostName", "(", ")", ":", "_addr", ".", "getHostAddress", "(", ")", ";", "}" ]
Get the Host. @return The IP address
[ "Get", "the", "Host", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/InetAddrPort.java#L112-L118
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/InetAddrPort.java
InetAddrPort.setHost
public void setHost(String host) throws java.net.UnknownHostException { _addr=null; if (host!=null) { if (host.indexOf('/')>0) host=host.substring(0,host.indexOf('/')); _addrIsHost=!Character.isDigit((host.charAt(0))); _addr=InetAdd...
java
public void setHost(String host) throws java.net.UnknownHostException { _addr=null; if (host!=null) { if (host.indexOf('/')>0) host=host.substring(0,host.indexOf('/')); _addrIsHost=!Character.isDigit((host.charAt(0))); _addr=InetAdd...
[ "public", "void", "setHost", "(", "String", "host", ")", "throws", "java", ".", "net", ".", "UnknownHostException", "{", "_addr", "=", "null", ";", "if", "(", "host", "!=", "null", ")", "{", "if", "(", "host", ".", "indexOf", "(", "'", "'", ")", ">...
Set the Host. @param host @exception java.net.UnknownHostException
[ "Set", "the", "Host", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/InetAddrPort.java#L125-L136
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Container.java
Container.start
public synchronized final void start() throws Exception { if (_started || _starting) return; _starting=true; if (log.isDebugEnabled()) log.debug("Starting "+this); LifeCycleEvent event = new LifeCycleEvent(this); for(int i=0;i<LazyList.size(...
java
public synchronized final void start() throws Exception { if (_started || _starting) return; _starting=true; if (log.isDebugEnabled()) log.debug("Starting "+this); LifeCycleEvent event = new LifeCycleEvent(this); for(int i=0;i<LazyList.size(...
[ "public", "synchronized", "final", "void", "start", "(", ")", "throws", "Exception", "{", "if", "(", "_started", "||", "_starting", ")", "return", ";", "_starting", "=", "true", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "...
Start the server. Generate LifeCycleEvents for starting and started either side of a call to doStart
[ "Start", "the", "server", ".", "Generate", "LifeCycleEvents", "for", "starting", "and", "started", "either", "side", "of", "a", "call", "to", "doStart" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Container.java#L53-L103
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Container.java
Container.stop
public synchronized final void stop() throws InterruptedException { if (!_started || _stopping) return; _stopping=true; if (log.isDebugEnabled()) log.debug("Stopping "+this); LifeCycleEvent event = new LifeCycleEvent(this); for(int i=0;i<LazyList.size(_event...
java
public synchronized final void stop() throws InterruptedException { if (!_started || _stopping) return; _stopping=true; if (log.isDebugEnabled()) log.debug("Stopping "+this); LifeCycleEvent event = new LifeCycleEvent(this); for(int i=0;i<LazyList.size(_event...
[ "public", "synchronized", "final", "void", "stop", "(", ")", "throws", "InterruptedException", "{", "if", "(", "!", "_started", "||", "_stopping", ")", "return", ";", "_stopping", "=", "true", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", ...
Stop the container. Generate LifeCycleEvents for stopping and stopped either side of a call to doStop
[ "Stop", "the", "container", ".", "Generate", "LifeCycleEvents", "for", "stopping", "and", "stopped", "either", "side", "of", "a", "call", "to", "doStop" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Container.java#L136-L185
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Container.java
Container.addEventListener
public void addEventListener(EventListener listener) throws IllegalArgumentException { if (_eventListeners==null) _eventListeners=new ArrayList(); if (listener instanceof ComponentListener || listener instanceof LifeCycleListener ) { ...
java
public void addEventListener(EventListener listener) throws IllegalArgumentException { if (_eventListeners==null) _eventListeners=new ArrayList(); if (listener instanceof ComponentListener || listener instanceof LifeCycleListener ) { ...
[ "public", "void", "addEventListener", "(", "EventListener", "listener", ")", "throws", "IllegalArgumentException", "{", "if", "(", "_eventListeners", "==", "null", ")", "_eventListeners", "=", "new", "ArrayList", "(", ")", ";", "if", "(", "listener", "instanceof",...
Add a server event listener. @param listener ComponentEventListener or LifeCycleEventListener
[ "Add", "a", "server", "event", "listener", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Container.java#L233-L247
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Flags.java
Flags.isFlag
public static boolean isFlag(int index) { flags.check(index); if ((index >= 1 && index <= 4) || (index >= 12)) return false; return true; }
java
public static boolean isFlag(int index) { flags.check(index); if ((index >= 1 && index <= 4) || (index >= 12)) return false; return true; }
[ "public", "static", "boolean", "isFlag", "(", "int", "index", ")", "{", "flags", ".", "check", "(", "index", ")", ";", "if", "(", "(", "index", ">=", "1", "&&", "index", "<=", "4", ")", "||", "(", "index", ">=", "12", ")", ")", "return", "false",...
Indicates if a bit in the flags field is a flag or not. If it's part of the rcode or opcode, it's not.
[ "Indicates", "if", "a", "bit", "in", "the", "flags", "field", "is", "a", "flag", "or", "not", ".", "If", "it", "s", "part", "of", "the", "rcode", "or", "opcode", "it", "s", "not", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Flags.java#L73-L79
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/nio/ByteBufferInputStream.java
ByteBufferInputStream.getBuffer
public synchronized ByteBuffer getBuffer() { ByteBuffer buf=null; int s=LazyList.size(_recycle); if (s>0) { s--; buf=(ByteBuffer)LazyList.get(_recycle, s); _recycle=LazyList.remove(_recycle,s); buf.clear(); } else ...
java
public synchronized ByteBuffer getBuffer() { ByteBuffer buf=null; int s=LazyList.size(_recycle); if (s>0) { s--; buf=(ByteBuffer)LazyList.get(_recycle, s); _recycle=LazyList.remove(_recycle,s); buf.clear(); } else ...
[ "public", "synchronized", "ByteBuffer", "getBuffer", "(", ")", "{", "ByteBuffer", "buf", "=", "null", ";", "int", "s", "=", "LazyList", ".", "size", "(", "_recycle", ")", ";", "if", "(", "s", ">", "0", ")", "{", "s", "--", ";", "buf", "=", "(", "...
Get a buffer to write to this InputStream. The buffer wll either be a new direct buffer or a recycled buffer.
[ "Get", "a", "buffer", "to", "write", "to", "this", "InputStream", ".", "The", "buffer", "wll", "either", "be", "a", "new", "direct", "buffer", "or", "a", "recycled", "buffer", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/nio/ByteBufferInputStream.java#L238-L254
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Table.java
Table.newRow
public Table newRow() { unnest(); nest(row = new Block("tr")); if (_defaultRow!=null) { row.setAttributesFrom(_defaultRow); if (_defaultRow.size()>0) row.add(_defaultRow.contents()); } cell=null; return this; }
java
public Table newRow() { unnest(); nest(row = new Block("tr")); if (_defaultRow!=null) { row.setAttributesFrom(_defaultRow); if (_defaultRow.size()>0) row.add(_defaultRow.contents()); } cell=null; return this; }
[ "public", "Table", "newRow", "(", ")", "{", "unnest", "(", ")", ";", "nest", "(", "row", "=", "new", "Block", "(", "\"tr\"", ")", ")", ";", "if", "(", "_defaultRow", "!=", "null", ")", "{", "row", ".", "setAttributesFrom", "(", "_defaultRow", ")", ...
Create new table row. Attributes set after this call and before a call to newCell or newHeader are considered row attributes.
[ "Create", "new", "table", "row", ".", "Attributes", "set", "after", "this", "call", "and", "before", "a", "call", "to", "newCell", "or", "newHeader", "are", "considered", "row", "attributes", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Table.java#L79-L91
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Table.java
Table.spacing
public Table spacing(int h, int v) { if (h>=0) attribute("hspace",h); if (v>=0) attribute("vspace",v); return this; }
java
public Table spacing(int h, int v) { if (h>=0) attribute("hspace",h); if (v>=0) attribute("vspace",v); return this; }
[ "public", "Table", "spacing", "(", "int", "h", ",", "int", "v", ")", "{", "if", "(", "h", ">=", "0", ")", "attribute", "(", "\"hspace\"", ",", "h", ")", ";", "if", "(", "v", ">=", "0", ")", "attribute", "(", "\"vspace\"", ",", "v", ")", ";", ...
Set horizontal and vertical spacing. @param h horizontal spacing @param v vertical spacing @return This table for call chaining
[ "Set", "horizontal", "and", "vertical", "spacing", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Table.java#L250-L257
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Table.java
Table.setCellNestingFactory
public static void setCellNestingFactory(CompositeFactory factory) { if (threadNestingMap==null) threadNestingMap= new Hashtable(); if (factory == null) threadNestingMap.remove(Thread.currentThread()); else threadNestingMap.put(Thread.currentThrea...
java
public static void setCellNestingFactory(CompositeFactory factory) { if (threadNestingMap==null) threadNestingMap= new Hashtable(); if (factory == null) threadNestingMap.remove(Thread.currentThread()); else threadNestingMap.put(Thread.currentThrea...
[ "public", "static", "void", "setCellNestingFactory", "(", "CompositeFactory", "factory", ")", "{", "if", "(", "threadNestingMap", "==", "null", ")", "threadNestingMap", "=", "new", "Hashtable", "(", ")", ";", "if", "(", "factory", "==", "null", ")", "threadNes...
Add cell nesting factory. Set the CompositeFactory for this thread. Each new cell in the table added by this thread will have a new Composite from this factory nested in the Cell. @param factory The factory for this Thread. If null clear this threads factory. @deprecated Use setNestingFactory or setThreadNestingFactory
[ "Add", "cell", "nesting", "factory", ".", "Set", "the", "CompositeFactory", "for", "this", "thread", ".", "Each", "new", "cell", "in", "the", "table", "added", "by", "this", "thread", "will", "have", "a", "new", "Composite", "from", "this", "factory", "nes...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Table.java#L290-L299
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java
ResourceCache.setResourceBase
public void setResourceBase(String resourceBase) { try{ _resourceBase=Resource.newResource(resourceBase); if(log.isDebugEnabled())log.debug("resourceBase="+_resourceBase+" for "+this); } catch(IOException e) { log.debug(LogSupport.EXCEPTION,e); ...
java
public void setResourceBase(String resourceBase) { try{ _resourceBase=Resource.newResource(resourceBase); if(log.isDebugEnabled())log.debug("resourceBase="+_resourceBase+" for "+this); } catch(IOException e) { log.debug(LogSupport.EXCEPTION,e); ...
[ "public", "void", "setResourceBase", "(", "String", "resourceBase", ")", "{", "try", "{", "_resourceBase", "=", "Resource", ".", "newResource", "(", "resourceBase", ")", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(",...
Set the Resource Base. The base resource is the Resource to use as a relative base for all context resources. The ResourceBase attribute is a string version of the baseResource. If a relative file is passed, it is converted to a file URL based on the current working directory. @param resourceBase A URL prefix or direct...
[ "Set", "the", "Resource", "Base", ".", "The", "base", "resource", "is", "the", "Resource", "to", "use", "as", "a", "relative", "base", "for", "all", "context", "resources", ".", "The", "ResourceBase", "attribute", "is", "a", "string", "version", "of", "the...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java#L129-L140
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java
ResourceCache.getResource
public Resource getResource(String pathInContext) throws IOException { if(log.isTraceEnabled())log.trace("getResource "+pathInContext); if (_resourceBase==null) return null; Resource resource=null; // Cache operations synchronized(_cache) { ...
java
public Resource getResource(String pathInContext) throws IOException { if(log.isTraceEnabled())log.trace("getResource "+pathInContext); if (_resourceBase==null) return null; Resource resource=null; // Cache operations synchronized(_cache) { ...
[ "public", "Resource", "getResource", "(", "String", "pathInContext", ")", "throws", "IOException", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "log", ".", "trace", "(", "\"getResource \"", "+", "pathInContext", ")", ";", "if", "(", "_resourc...
Get a resource from the context. Cached Resources are returned if the resource fits within the LRU cache. Directories may have CachedResources returned, but the caller must use the CachedResource.setCachedData method to set the formatted directory content. @param pathInContext @return Resource @exception IOException
[ "Get", "a", "resource", "from", "the", "context", ".", "Cached", "Resources", "are", "returned", "if", "the", "resource", "fits", "within", "the", "LRU", "cache", ".", "Directories", "may", "have", "CachedResources", "returned", "but", "the", "caller", "must",...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java#L212-L284
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java
ResourceCache.getEncodingByMimeType
public String getEncodingByMimeType(String type) { String encoding =null; if (type!=null) encoding=(String)_encodingMap.get(type); return encoding; }
java
public String getEncodingByMimeType(String type) { String encoding =null; if (type!=null) encoding=(String)_encodingMap.get(type); return encoding; }
[ "public", "String", "getEncodingByMimeType", "(", "String", "type", ")", "{", "String", "encoding", "=", "null", ";", "if", "(", "type", "!=", "null", ")", "encoding", "=", "(", "String", ")", "_encodingMap", ".", "get", "(", "type", ")", ";", "return", ...
Get char encoding by mime type. @param type A mime type. @return The prefered character encoding for that type if known.
[ "Get", "char", "encoding", "by", "mime", "type", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java#L381-L389
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java
ResourceCache.getResourceMetaData
public ResourceMetaData getResourceMetaData(Resource resource) { Object o=resource.getAssociate(); if (o instanceof ResourceMetaData) return (ResourceMetaData)o; return new ResourceMetaData(resource); }
java
public ResourceMetaData getResourceMetaData(Resource resource) { Object o=resource.getAssociate(); if (o instanceof ResourceMetaData) return (ResourceMetaData)o; return new ResourceMetaData(resource); }
[ "public", "ResourceMetaData", "getResourceMetaData", "(", "Resource", "resource", ")", "{", "Object", "o", "=", "resource", ".", "getAssociate", "(", ")", ";", "if", "(", "o", "instanceof", "ResourceMetaData", ")", "return", "(", "ResourceMetaData", ")", "o", ...
Get Resource MetaData. @param resource @return Meta data for the resource.
[ "Get", "Resource", "MetaData", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ResourceCache.java#L449-L455
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/start/Version.java
Version.compare
public int compare(Version other) { if (other == null) throw new NullPointerException("other version is null"); if (this._version < other._version) return -1; if (this._version > other._version) return 1; if (this._revision < other._revision) return -1; if (this._revision > other...
java
public int compare(Version other) { if (other == null) throw new NullPointerException("other version is null"); if (this._version < other._version) return -1; if (this._version > other._version) return 1; if (this._revision < other._revision) return -1; if (this._revision > other...
[ "public", "int", "compare", "(", "Version", "other", ")", "{", "if", "(", "other", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"other version is null\"", ")", ";", "if", "(", "this", ".", "_version", "<", "other", ".", "_version", ")"...
Compares with other version. Does not take extension into account, as there is no reliable way to order them. @return -1 if this is older version that other, 0 if its same version, 1 if it's newer version than other
[ "Compares", "with", "other", "version", ".", "Does", "not", "take", "extension", "into", "account", "as", "there", "is", "no", "reliable", "way", "to", "order", "them", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/start/Version.java#L94-L103
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/ResolverConfig.java
ResolverConfig.findWin
private void findWin(InputStream in) { String packageName = ResolverConfig.class.getPackage().getName(); String resPackageName = packageName + ".windows.DNSServer"; ResourceBundle res = ResourceBundle.getBundle(resPackageName); String host_name = res.getString("host_name"); String primary_dns_suffix = res.getStri...
java
private void findWin(InputStream in) { String packageName = ResolverConfig.class.getPackage().getName(); String resPackageName = packageName + ".windows.DNSServer"; ResourceBundle res = ResourceBundle.getBundle(resPackageName); String host_name = res.getString("host_name"); String primary_dns_suffix = res.getStri...
[ "private", "void", "findWin", "(", "InputStream", "in", ")", "{", "String", "packageName", "=", "ResolverConfig", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ";", "String", "resPackageName", "=", "packageName", "+", "\".windows.DNSServ...
Parses the output of winipcfg or ipconfig.
[ "Parses", "the", "output", "of", "winipcfg", "or", "ipconfig", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/ResolverConfig.java#L251-L335
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/Frame.java
Frame.complete
void complete() { _file=_stack[_top].getFileName()+":"+_stack[_top].getLineNumber(); _method=_stack[_top].getClassName()+"."+_stack[_top].getMethodName(); _depth=_stack.length-_top; _thread = Thread.currentThread().getName(); }
java
void complete() { _file=_stack[_top].getFileName()+":"+_stack[_top].getLineNumber(); _method=_stack[_top].getClassName()+"."+_stack[_top].getMethodName(); _depth=_stack.length-_top; _thread = Thread.currentThread().getName(); }
[ "void", "complete", "(", ")", "{", "_file", "=", "_stack", "[", "_top", "]", ".", "getFileName", "(", ")", "+", "\":\"", "+", "_stack", "[", "_top", "]", ".", "getLineNumber", "(", ")", ";", "_method", "=", "_stack", "[", "_top", "]", ".", "getClas...
Complete partial constructor.
[ "Complete", "partial", "constructor", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/Frame.java#L108-L114
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java
DNSJavaNameService.lookupAllHostAddr
public InetAddress [] lookupAllHostAddr(String host) throws UnknownHostException { Name name = null; try { name = new Name(host); } catch (TextParseException e) { throw new UnknownHostException(host); } Record [] records = null; if (preferV6) records = new Lookup(name, Type.AAAA).run(); if (records == n...
java
public InetAddress [] lookupAllHostAddr(String host) throws UnknownHostException { Name name = null; try { name = new Name(host); } catch (TextParseException e) { throw new UnknownHostException(host); } Record [] records = null; if (preferV6) records = new Lookup(name, Type.AAAA).run(); if (records == n...
[ "public", "InetAddress", "[", "]", "lookupAllHostAddr", "(", "String", "host", ")", "throws", "UnknownHostException", "{", "Name", "name", "=", "null", ";", "try", "{", "name", "=", "new", "Name", "(", "host", ")", ";", "}", "catch", "(", "TextParseExcepti...
Performs a forward DNS lookup for the host name. @param host The host name to resolve. @return All the ip addresses found for the host name.
[ "Performs", "a", "forward", "DNS", "lookup", "for", "the", "host", "name", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java#L110-L143
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java
DNSJavaNameService.getHostByAddr
public String getHostByAddr(byte [] addr) throws UnknownHostException { Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr)); Record [] records = new Lookup(name, Type.PTR).run(); if (records == null) throw new UnknownHostException(); return ((PTRRecord) records[0]).getTarget().toString(); }
java
public String getHostByAddr(byte [] addr) throws UnknownHostException { Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr)); Record [] records = new Lookup(name, Type.PTR).run(); if (records == null) throw new UnknownHostException(); return ((PTRRecord) records[0]).getTarget().toString(); }
[ "public", "String", "getHostByAddr", "(", "byte", "[", "]", "addr", ")", "throws", "UnknownHostException", "{", "Name", "name", "=", "ReverseMap", ".", "fromAddress", "(", "InetAddress", ".", "getByAddress", "(", "addr", ")", ")", ";", "Record", "[", "]", ...
Performs a reverse DNS lookup. @param addr The ip address to lookup. @return The host name found for the ip address.
[ "Performs", "a", "reverse", "DNS", "lookup", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/spi/DNSJavaNameService.java#L150-L156
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/selenium/ThumbprintUtil.java
ThumbprintUtil.getThumbprint
public static String getThumbprint(final X509Certificate cert) throws CertificateEncodingException { if(cert == null) { return null; } byte[] rawOctets = cert.getEncoded(); SHA1Digest digest = new SHA1Digest(); byte[] digestOctets = new byte[digest.getDigestSize()]; digest.update(rawOctets, 0, raw...
java
public static String getThumbprint(final X509Certificate cert) throws CertificateEncodingException { if(cert == null) { return null; } byte[] rawOctets = cert.getEncoded(); SHA1Digest digest = new SHA1Digest(); byte[] digestOctets = new byte[digest.getDigestSize()]; digest.update(rawOctets, 0, raw...
[ "public", "static", "String", "getThumbprint", "(", "final", "X509Certificate", "cert", ")", "throws", "CertificateEncodingException", "{", "if", "(", "cert", "==", "null", ")", "{", "return", "null", ";", "}", "byte", "[", "]", "rawOctets", "=", "cert", "."...
Generates a SHA1 thumbprint of a certificate for long-term mapping. @param cert @return @throws java.security.cert.CertificateEncodingException
[ "Generates", "a", "SHA1", "thumbprint", "of", "a", "certificate", "for", "long", "-", "term", "mapping", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/ThumbprintUtil.java#L30-L48
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java
XmlParser.parse
public synchronized Node parse(String url) throws IOException,SAXException { if(log.isDebugEnabled()) log.debug("parse: "+url); return parse(new InputSource(url)); }
java
public synchronized Node parse(String url) throws IOException,SAXException { if(log.isDebugEnabled()) log.debug("parse: "+url); return parse(new InputSource(url)); }
[ "public", "synchronized", "Node", "parse", "(", "String", "url", ")", "throws", "IOException", ",", "SAXException", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"parse: \"", "+", "url", ")", ";", "return", "par...
Parse string URL.
[ "Parse", "string", "URL", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java#L177-L182
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java
XmlParser.parse
public synchronized Node parse(File file) throws IOException,SAXException { if(log.isDebugEnabled()) log.debug("parse: "+file); return parse(new InputSource(file.toURL().toString())); }
java
public synchronized Node parse(File file) throws IOException,SAXException { if(log.isDebugEnabled()) log.debug("parse: "+file); return parse(new InputSource(file.toURL().toString())); }
[ "public", "synchronized", "Node", "parse", "(", "File", "file", ")", "throws", "IOException", ",", "SAXException", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"parse: \"", "+", "file", ")", ";", "return", "par...
Parse File.
[ "Parse", "File", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java#L188-L193
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java
XmlParser.parse
public synchronized Node parse(InputStream in) throws IOException,SAXException { Handler handler=new Handler(); XMLReader reader=_parser.getXMLReader(); reader.setContentHandler(handler); reader.setErrorHandler(handler); reader.setEntityResolver(handler); _parser.pars...
java
public synchronized Node parse(InputStream in) throws IOException,SAXException { Handler handler=new Handler(); XMLReader reader=_parser.getXMLReader(); reader.setContentHandler(handler); reader.setErrorHandler(handler); reader.setEntityResolver(handler); _parser.pars...
[ "public", "synchronized", "Node", "parse", "(", "InputStream", "in", ")", "throws", "IOException", ",", "SAXException", "{", "Handler", "handler", "=", "new", "Handler", "(", ")", ";", "XMLReader", "reader", "=", "_parser", ".", "getXMLReader", "(", ")", ";"...
Parse InputStream.
[ "Parse", "InputStream", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java#L199-L212
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java
XmlParser.parse
public synchronized Node parse(URL url) throws IOException,SAXException { Node n=null; InputStream is=url.openStream(); try { n=parse(is); } finally { try { is.close(); } catch(Excepti...
java
public synchronized Node parse(URL url) throws IOException,SAXException { Node n=null; InputStream is=url.openStream(); try { n=parse(is); } finally { try { is.close(); } catch(Excepti...
[ "public", "synchronized", "Node", "parse", "(", "URL", "url", ")", "throws", "IOException", ",", "SAXException", "{", "Node", "n", "=", "null", ";", "InputStream", "is", "=", "url", ".", "openStream", "(", ")", ";", "try", "{", "n", "=", "parse", "(", ...
Parse URL.
[ "Parse", "URL", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlParser.java#L218-L240
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/AbstractHttpHandler.java
AbstractHttpHandler.initialize
public void initialize(HttpContext context) { if (_context==null) _context=context; else if (_context!=context) throw new IllegalStateException("Can't initialize handler for different context"); }
java
public void initialize(HttpContext context) { if (_context==null) _context=context; else if (_context!=context) throw new IllegalStateException("Can't initialize handler for different context"); }
[ "public", "void", "initialize", "(", "HttpContext", "context", ")", "{", "if", "(", "_context", "==", "null", ")", "_context", "=", "context", ";", "else", "if", "(", "_context", "!=", "context", ")", "throw", "new", "IllegalStateException", "(", "\"Can't in...
Initialize with a HttpContext. Called by addHandler methods of HttpContext. @param context Must be the HttpContext of the handler
[ "Initialize", "with", "a", "HttpContext", ".", "Called", "by", "addHandler", "methods", "of", "HttpContext", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/AbstractHttpHandler.java#L73-L79
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/jmx/ConfigurationMBean.java
ConfigurationMBean.uniqueObjectName
public synchronized ObjectName uniqueObjectName(MBeanServer server, String on) { ObjectName oName=null; try{oName=new ObjectName(on+",config="+_config.getClass().getName());} catch(Exception e){log.warn(LogSupport.EXCEPTION,e);} return oName; }
java
public synchronized ObjectName uniqueObjectName(MBeanServer server, String on) { ObjectName oName=null; try{oName=new ObjectName(on+",config="+_config.getClass().getName());} catch(Exception e){log.warn(LogSupport.EXCEPTION,e);} return oName; }
[ "public", "synchronized", "ObjectName", "uniqueObjectName", "(", "MBeanServer", "server", ",", "String", "on", ")", "{", "ObjectName", "oName", "=", "null", ";", "try", "{", "oName", "=", "new", "ObjectName", "(", "on", "+", "\",config=\"", "+", "_config", "...
uniqueObjectName Make a unique jmx name for this configuration object @see org.browsermob.proxy.jetty.util.jmx.ModelMBeanImpl#uniqueObjectName(javax.management.MBeanServer, java.lang.String)
[ "uniqueObjectName", "Make", "a", "unique", "jmx", "name", "for", "this", "configuration", "object" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/jmx/ConfigurationMBean.java#L78-L85
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogStream.java
LogStream.setLogStdErr
public static void setLogStdErr(boolean log) { if (log) { if (!(System.err instanceof LogStream)) System.setErr(new LogStream.STDERR()); } else System.setErr(STDERR_STREAM); }
java
public static void setLogStdErr(boolean log) { if (log) { if (!(System.err instanceof LogStream)) System.setErr(new LogStream.STDERR()); } else System.setErr(STDERR_STREAM); }
[ "public", "static", "void", "setLogStdErr", "(", "boolean", "log", ")", "{", "if", "(", "log", ")", "{", "if", "(", "!", "(", "System", ".", "err", "instanceof", "LogStream", ")", ")", "System", ".", "setErr", "(", "new", "LogStream", ".", "STDERR", ...
Log standard error stream. If set to true, output to stderr will be directed to an instance of LogStream and logged. Beware of log loops from logs that write to stderr.
[ "Log", "standard", "error", "stream", ".", "If", "set", "to", "true", "output", "to", "stderr", "will", "be", "directed", "to", "an", "instance", "of", "LogStream", "and", "logged", ".", "Beware", "of", "log", "loops", "from", "logs", "that", "write", "t...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogStream.java#L46-L55
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogStream.java
LogStream.setLogStdOut
public static void setLogStdOut(boolean log) { if (log) { if (!(System.out instanceof LogStream)) System.setOut(new LogStream.STDOUT()); } else System.setOut(STDOUT_STREAM); }
java
public static void setLogStdOut(boolean log) { if (log) { if (!(System.out instanceof LogStream)) System.setOut(new LogStream.STDOUT()); } else System.setOut(STDOUT_STREAM); }
[ "public", "static", "void", "setLogStdOut", "(", "boolean", "log", ")", "{", "if", "(", "log", ")", "{", "if", "(", "!", "(", "System", ".", "out", "instanceof", "LogStream", ")", ")", "System", ".", "setOut", "(", "new", "LogStream", ".", "STDOUT", ...
Log standard output stream. If set to true, output to stdout will be directed to an instance of LogStream and logged. Beware of log loops from logs that write to stdout.
[ "Log", "standard", "output", "stream", ".", "If", "set", "to", "true", "output", "to", "stdout", "will", "be", "directed", "to", "an", "instance", "of", "LogStream", "and", "logged", ".", "Beware", "of", "log", "loops", "from", "logs", "that", "write", "...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogStream.java#L68-L77
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.getFieldValues
public Enumeration getFieldValues(String name,String separators) { return _header.getValues(name,separators); }
java
public Enumeration getFieldValues(String name,String separators) { return _header.getValues(name,separators); }
[ "public", "Enumeration", "getFieldValues", "(", "String", "name", ",", "String", "separators", ")", "{", "return", "_header", ".", "getValues", "(", "name", ",", "separators", ")", ";", "}" ]
Get a multi valued message field. Get a field from a message header. @param name The field name @param separators String of separators. @return Enumeration of field values or null
[ "Get", "a", "multi", "valued", "message", "field", ".", "Get", "a", "field", "from", "a", "message", "header", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L252-L255
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.setIntField
public void setIntField(String name, int value) { if (_state!=__MSG_EDITABLE) return; _header.put(name, TypeUtil.toString(value)); }
java
public void setIntField(String name, int value) { if (_state!=__MSG_EDITABLE) return; _header.put(name, TypeUtil.toString(value)); }
[ "public", "void", "setIntField", "(", "String", "name", ",", "int", "value", ")", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "return", ";", "_header", ".", "put", "(", "name", ",", "TypeUtil", ".", "toString", "(", "value", ")", ")", ";", ...
Sets the value of an integer field. Header or Trailer fields are set depending on message state. @param name the field name @param value the field integer value
[ "Sets", "the", "value", "of", "an", "integer", "field", ".", "Header", "or", "Trailer", "fields", "are", "set", "depending", "on", "message", "state", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L333-L338
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.addIntField
public void addIntField(String name, int value) { if (_state!=__MSG_EDITABLE) return; _header.add(name, TypeUtil.toString(value)); }
java
public void addIntField(String name, int value) { if (_state!=__MSG_EDITABLE) return; _header.add(name, TypeUtil.toString(value)); }
[ "public", "void", "addIntField", "(", "String", "name", ",", "int", "value", ")", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "return", ";", "_header", ".", "add", "(", "name", ",", "TypeUtil", ".", "toString", "(", "value", ")", ")", ";", ...
Adds the value of an integer field. Header or Trailer fields are set depending on message state. @param name the field name @param value the field integer value
[ "Adds", "the", "value", "of", "an", "integer", "field", ".", "Header", "or", "Trailer", "fields", "are", "set", "depending", "on", "message", "state", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L346-L351
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.addDateField
public void addDateField(String name, Date date) { if (_state!=__MSG_EDITABLE) return; _header.addDateField(name,date); }
java
public void addDateField(String name, Date date) { if (_state!=__MSG_EDITABLE) return; _header.addDateField(name,date); }
[ "public", "void", "addDateField", "(", "String", "name", ",", "Date", "date", ")", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "return", ";", "_header", ".", "addDateField", "(", "name", ",", "date", ")", ";", "}" ]
Adds the value of a date field. Header or Trailer fields are set depending on message state. @param name the field name @param date the field date value
[ "Adds", "the", "value", "of", "a", "date", "field", ".", "Header", "or", "Trailer", "fields", "are", "set", "depending", "on", "message", "state", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L385-L390
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.setDateField
public void setDateField(String name, long date) { if (_state!=__MSG_EDITABLE) return; _header.putDateField(name,date); }
java
public void setDateField(String name, long date) { if (_state!=__MSG_EDITABLE) return; _header.putDateField(name,date); }
[ "public", "void", "setDateField", "(", "String", "name", ",", "long", "date", ")", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "return", ";", "_header", ".", "putDateField", "(", "name", ",", "date", ")", ";", "}" ]
Sets the value of a date field. Header or Trailer fields are set depending on message state. @param name the field name @param date the field date value
[ "Sets", "the", "value", "of", "a", "date", "field", ".", "Header", "or", "Trailer", "fields", "are", "set", "depending", "on", "message", "state", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L398-L403
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.setVersion
public void setVersion(String version) { if (_state!=__MSG_EDITABLE) throw new IllegalStateException("Not EDITABLE"); if (version.equalsIgnoreCase(__HTTP_1_1)) { _dotVersion=1; _version=__HTTP_1_1; } else if (version.equalsIgnoreCase(__HTTP...
java
public void setVersion(String version) { if (_state!=__MSG_EDITABLE) throw new IllegalStateException("Not EDITABLE"); if (version.equalsIgnoreCase(__HTTP_1_1)) { _dotVersion=1; _version=__HTTP_1_1; } else if (version.equalsIgnoreCase(__HTTP...
[ "public", "void", "setVersion", "(", "String", "version", ")", "{", "if", "(", "_state", "!=", "__MSG_EDITABLE", ")", "throw", "new", "IllegalStateException", "(", "\"Not EDITABLE\"", ")", ";", "if", "(", "version", ".", "equalsIgnoreCase", "(", "__HTTP_1_1", ...
Set the request version @param version the HTTP version string (eg HTTP/1.1) @exception IllegalStateException message is not EDITABLE
[ "Set", "the", "request", "version" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L442-L463
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.setCharacterEncoding
public void setCharacterEncoding(String encoding,boolean setField) { if (isCommitted()) return; if (encoding==null) { // Clear any encoding. if (_characterEncoding!=null) { _characterEncoding=null; if (s...
java
public void setCharacterEncoding(String encoding,boolean setField) { if (isCommitted()) return; if (encoding==null) { // Clear any encoding. if (_characterEncoding!=null) { _characterEncoding=null; if (s...
[ "public", "void", "setCharacterEncoding", "(", "String", "encoding", ",", "boolean", "setField", ")", "{", "if", "(", "isCommitted", "(", ")", ")", "return", ";", "if", "(", "encoding", "==", "null", ")", "{", "// Clear any encoding.", "if", "(", "_character...
Set Character Encoding. @param encoding An encoding that can override the encoding set from the ContentType field.
[ "Set", "Character", "Encoding", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L506-L532
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.recycle
void recycle(HttpConnection connection) { _state=__MSG_EDITABLE; _version=__HTTP_1_1; _dotVersion=1; _header.clear(); _connection=connection; _characterEncoding=null; _mimeType=null; if (_attributes!=null) _attributes.clear(); }
java
void recycle(HttpConnection connection) { _state=__MSG_EDITABLE; _version=__HTTP_1_1; _dotVersion=1; _header.clear(); _connection=connection; _characterEncoding=null; _mimeType=null; if (_attributes!=null) _attributes.clear(); }
[ "void", "recycle", "(", "HttpConnection", "connection", ")", "{", "_state", "=", "__MSG_EDITABLE", ";", "_version", "=", "__HTTP_1_1", ";", "_dotVersion", "=", "1", ";", "_header", ".", "clear", "(", ")", ";", "_connection", "=", "connection", ";", "_charact...
Recycle the message.
[ "Recycle", "the", "message", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L640-L651
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.getAttribute
public Object getAttribute(String name) { if (_attributes==null) return null; return _attributes.get(name); }
java
public Object getAttribute(String name) { if (_attributes==null) return null; return _attributes.get(name); }
[ "public", "Object", "getAttribute", "(", "String", "name", ")", "{", "if", "(", "_attributes", "==", "null", ")", "return", "null", ";", "return", "_attributes", ".", "get", "(", "name", ")", ";", "}" ]
Get a request attribute. @param name Attribute name @return Attribute value
[ "Get", "a", "request", "attribute", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L720-L725
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.setAttribute
public Object setAttribute(String name, Object attribute) { if (_attributes==null) _attributes=new HashMap(11); return _attributes.put(name,attribute); }
java
public Object setAttribute(String name, Object attribute) { if (_attributes==null) _attributes=new HashMap(11); return _attributes.put(name,attribute); }
[ "public", "Object", "setAttribute", "(", "String", "name", ",", "Object", "attribute", ")", "{", "if", "(", "_attributes", "==", "null", ")", "_attributes", "=", "new", "HashMap", "(", "11", ")", ";", "return", "_attributes", ".", "put", "(", "name", ","...
Set a request attribute. @param name Attribute name @param attribute Attribute value @return Previous Attribute value
[ "Set", "a", "request", "attribute", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L733-L738
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java
HttpMessage.getAttributeNames
public Enumeration getAttributeNames() { if (_attributes==null) return Collections.enumeration(Collections.EMPTY_LIST); return Collections.enumeration(_attributes.keySet()); }
java
public Enumeration getAttributeNames() { if (_attributes==null) return Collections.enumeration(Collections.EMPTY_LIST); return Collections.enumeration(_attributes.keySet()); }
[ "public", "Enumeration", "getAttributeNames", "(", ")", "{", "if", "(", "_attributes", "==", "null", ")", "return", "Collections", ".", "enumeration", "(", "Collections", ".", "EMPTY_LIST", ")", ";", "return", "Collections", ".", "enumeration", "(", "_attributes...
Get Attribute names. @return Enumeration of Strings
[ "Get", "Attribute", "names", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpMessage.java#L744-L749
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Holder.java
Holder.put
public synchronized Object put(Object name,Object value) { if (_initParams==null) _initParams=new HashMap(3); return _initParams.put(name,value); }
java
public synchronized Object put(Object name,Object value) { if (_initParams==null) _initParams=new HashMap(3); return _initParams.put(name,value); }
[ "public", "synchronized", "Object", "put", "(", "Object", "name", ",", "Object", "value", ")", "{", "if", "(", "_initParams", "==", "null", ")", "_initParams", "=", "new", "HashMap", "(", "3", ")", ";", "return", "_initParams", ".", "put", "(", "name", ...
Map put method. FilterHolder implements the Map interface as a configuration conveniance. The methods are mapped to the filter properties.
[ "Map", "put", "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#L159-L164
train