id
int32
0
165k
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
100,700
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/URLResource.java
URLResource.addPath
public Resource addPath(String path) throws IOException,MalformedURLException { if (path==null) return null; path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(),path)); }
java
public Resource addPath(String path) throws IOException,MalformedURLException { if (path==null) return null; path = URI.canonicalPath(path); return newResource(URI.addPaths(_url.toExternalForm(),path)); }
[ "public", "Resource", "addPath", "(", "String", "path", ")", "throws", "IOException", ",", "MalformedURLException", "{", "if", "(", "path", "==", "null", ")", "return", "null", ";", "path", "=", "URI", ".", "canonicalPath", "(", "path", ")", ";", "return",...
Returns the resource contained inside the current resource with the given name
[ "Returns", "the", "resource", "contained", "inside", "the", "current", "resource", "with", "the", "given", "name" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/URLResource.java#L253-L262
100,701
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java
ServletHttpContext.getServletHandler
public synchronized ServletHandler getServletHandler() { if (_servletHandler==null) _servletHandler=(ServletHandler) getHandler(ServletHandler.class); if (_servletHandler==null) { _servletHandler=new ServletHandler(); addHandler(_servletHandler); }...
java
public synchronized ServletHandler getServletHandler() { if (_servletHandler==null) _servletHandler=(ServletHandler) getHandler(ServletHandler.class); if (_servletHandler==null) { _servletHandler=new ServletHandler(); addHandler(_servletHandler); }...
[ "public", "synchronized", "ServletHandler", "getServletHandler", "(", ")", "{", "if", "(", "_servletHandler", "==", "null", ")", "_servletHandler", "=", "(", "ServletHandler", ")", "getHandler", "(", "ServletHandler", ".", "class", ")", ";", "if", "(", "_servlet...
Get the context ServletHandler. Conveniance method. If no ServletHandler exists, a new one is added to the context. @return ServletHandler
[ "Get", "the", "context", "ServletHandler", ".", "Conveniance", "method", ".", "If", "no", "ServletHandler", "exists", "a", "new", "one", "is", "added", "to", "the", "context", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L67-L77
100,702
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java
ServletHttpContext.addServlet
public synchronized ServletHolder addServlet(String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { return addServlet(className,pathSpec,className); }
java
public synchronized ServletHolder addServlet(String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { return addServlet(className,pathSpec,className); }
[ "public", "synchronized", "ServletHolder", "addServlet", "(", "String", "pathSpec", ",", "String", "className", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "return", "addServlet", "(", "className", ",", "pa...
Add a servlet to the context. Conveniance method. If no ServletHandler is found in the context, a new one is added. @param pathSpec The pathspec within the context @param className The classname of the servlet. @return The ServletHolder. @exception ClassNotFoundException @exception InstantiationException @exception Ill...
[ "Add", "a", "servlet", "to", "the", "context", ".", "Conveniance", "method", ".", "If", "no", "ServletHandler", "is", "found", "in", "the", "context", "a", "new", "one", "is", "added", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L90-L97
100,703
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java
ServletHttpContext.addServlet
public synchronized ServletHolder addServlet(String name, String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { ...
java
public synchronized ServletHolder addServlet(String name, String pathSpec, String className) throws ClassNotFoundException, InstantiationException, IllegalAccessException { ...
[ "public", "synchronized", "ServletHolder", "addServlet", "(", "String", "name", ",", "String", "pathSpec", ",", "String", "className", ")", "throws", "ClassNotFoundException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "return", "getServletHandler"...
Add a servlet to the context. If no ServletHandler is found in the context, a new one is added. @param name The name of the servlet. @param pathSpec The pathspec within the context @param className The classname of the servlet. @return The ServletHolder. @exception ClassNotFoundException @exception InstantiationExcepti...
[ "Add", "a", "servlet", "to", "the", "context", ".", "If", "no", "ServletHandler", "is", "found", "in", "the", "context", "a", "new", "one", "is", "added", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L110-L118
100,704
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java
ServletHttpContext.getLocaleEncoding
public String getLocaleEncoding(Locale locale) { String encoding = (String)_localeEncodingMap.get(locale.toString()); if (encoding==null) encoding = (String)_localeEncodingMap.get(locale.getLanguage()); return encoding; }
java
public String getLocaleEncoding(Locale locale) { String encoding = (String)_localeEncodingMap.get(locale.toString()); if (encoding==null) encoding = (String)_localeEncodingMap.get(locale.getLanguage()); return encoding; }
[ "public", "String", "getLocaleEncoding", "(", "Locale", "locale", ")", "{", "String", "encoding", "=", "(", "String", ")", "_localeEncodingMap", ".", "get", "(", "locale", ".", "toString", "(", ")", ")", ";", "if", "(", "encoding", "==", "null", ")", "en...
Get the character encoding for a locale. The full locale name is first looked up in the map of encodings. If no encoding is found, then the locale language is looked up. @param locale a <code>Locale</code> value @return a <code>String</code> representing the character encoding for the locale or null if none found.
[ "Get", "the", "character", "encoding", "for", "a", "locale", ".", "The", "full", "locale", "name", "is", "first", "looked", "up", "in", "the", "map", "of", "encodings", ".", "If", "no", "encoding", "is", "found", "then", "the", "locale", "language", "is"...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpContext.java#L165-L171
100,705
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/StringMap.java
StringMap.getEntry
public Map.Entry getEntry(String key,int offset, int length) { if (key==null) return _nullEntry; Node node = _root; int ni=-1; // look for best match charLoop: for (int i=0;i<length;i++) { char c=key.charAt(offset+i); ...
java
public Map.Entry getEntry(String key,int offset, int length) { if (key==null) return _nullEntry; Node node = _root; int ni=-1; // look for best match charLoop: for (int i=0;i<length;i++) { char c=key.charAt(offset+i); ...
[ "public", "Map", ".", "Entry", "getEntry", "(", "String", "key", ",", "int", "offset", ",", "int", "length", ")", "{", "if", "(", "key", "==", "null", ")", "return", "_nullEntry", ";", "Node", "node", "=", "_root", ";", "int", "ni", "=", "-", "1", ...
Get a map entry by substring key. @param key String containing the key @param offset Offset of the key within the String. @param length The length of the key @return The Map.Entry for the key or null if the key is not in the map.
[ "Get", "a", "map", "entry", "by", "substring", "key", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringMap.java#L257-L303
100,706
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/selenium/LauncherUtils.java
LauncherUtils.recursivelyDeleteDir
public static void recursivelyDeleteDir(File customProfileDir) { if (customProfileDir == null || !customProfileDir.exists()) { return; } Delete delete = new Delete(); delete.setProject(new Project()); delete.setDir(customProfileDir); delete.setFailOnError(true); delete.execute(); }
java
public static void recursivelyDeleteDir(File customProfileDir) { if (customProfileDir == null || !customProfileDir.exists()) { return; } Delete delete = new Delete(); delete.setProject(new Project()); delete.setDir(customProfileDir); delete.setFailOnError(true); delete.execute(); }
[ "public", "static", "void", "recursivelyDeleteDir", "(", "File", "customProfileDir", ")", "{", "if", "(", "customProfileDir", "==", "null", "||", "!", "customProfileDir", ".", "exists", "(", ")", ")", "{", "return", ";", "}", "Delete", "delete", "=", "new", ...
Delete a directory and all subdirectories
[ "Delete", "a", "directory", "and", "all", "subdirectories" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/LauncherUtils.java#L42-L51
100,707
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/BufferedOutputStream.java
BufferedOutputStream.flush
public void flush() throws IOException { try { if (!_commited) { _commited=true; if (_commitObserver!=null) _commitObserver.outputNotify(this,OutputObserver.__COMMITING,null); } w...
java
public void flush() throws IOException { try { if (!_commited) { _commited=true; if (_commitObserver!=null) _commitObserver.outputNotify(this,OutputObserver.__COMMITING,null); } w...
[ "public", "void", "flush", "(", ")", "throws", "IOException", "{", "try", "{", "if", "(", "!", "_commited", ")", "{", "_commited", "=", "true", ";", "if", "(", "_commitObserver", "!=", "null", ")", "_commitObserver", ".", "outputNotify", "(", "this", ","...
This implementation calls the commitObserver on the first flush since construction or reset.
[ "This", "implementation", "calls", "the", "commitObserver", "on", "the", "first", "flush", "since", "construction", "or", "reset", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/BufferedOutputStream.java#L183-L215
100,708
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java
LogImpl.reset
public synchronized void reset() { info("reset"); if (_sinks!=null) { for (int s=_sinks.length;s-->0;) { try{ if (_sinks[s]!=null) _sinks[s].stop(); _sinks[s]=null; } ...
java
public synchronized void reset() { info("reset"); if (_sinks!=null) { for (int s=_sinks.length;s-->0;) { try{ if (_sinks[s]!=null) _sinks[s].stop(); _sinks[s]=null; } ...
[ "public", "synchronized", "void", "reset", "(", ")", "{", "info", "(", "\"reset\"", ")", ";", "if", "(", "_sinks", "!=", "null", ")", "{", "for", "(", "int", "s", "=", "_sinks", ".", "length", ";", "s", "--", ">", "0", ";", ")", "{", "try", "{"...
No logging. All log sinks are stopped and removed.
[ "No", "logging", ".", "All", "log", "sinks", "are", "stopped", "and", "removed", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L227-L247
100,709
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java
LogImpl.message
public synchronized void message(String tag, Object msg, Frame frame, long time) { if (!_initialized) defaultInit(); boolean logged=false; if (_sinks!=null) ...
java
public synchronized void message(String tag, Object msg, Frame frame, long time) { if (!_initialized) defaultInit(); boolean logged=false; if (_sinks!=null) ...
[ "public", "synchronized", "void", "message", "(", "String", "tag", ",", "Object", "msg", ",", "Frame", "frame", ",", "long", "time", ")", "{", "if", "(", "!", "_initialized", ")", "defaultInit", "(", ")", ";", "boolean", "logged", "=", "false", ";", "i...
Log a message. @param tag Tag for type of log @param msg The message @param frame The frame that generated the message. @param time The time stamp of the message.
[ "Log", "a", "message", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L410-L436
100,710
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java
LogImpl.setDebug
public synchronized void setDebug(boolean debug) { boolean oldDebug=_debugOn; if (_debugOn && !debug) this.message(DEBUG,"DEBUG OFF"); _debugOn=debug; if (!oldDebug && debug) this.message(DEBUG,"DEBUG ON"); }
java
public synchronized void setDebug(boolean debug) { boolean oldDebug=_debugOn; if (_debugOn && !debug) this.message(DEBUG,"DEBUG OFF"); _debugOn=debug; if (!oldDebug && debug) this.message(DEBUG,"DEBUG ON"); }
[ "public", "synchronized", "void", "setDebug", "(", "boolean", "debug", ")", "{", "boolean", "oldDebug", "=", "_debugOn", ";", "if", "(", "_debugOn", "&&", "!", "debug", ")", "this", ".", "message", "(", "DEBUG", ",", "\"DEBUG OFF\"", ")", ";", "_debugOn", ...
Set if debugging is on or off. @param debug
[ "Set", "if", "debugging", "is", "on", "or", "off", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L465-L473
100,711
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java
LogImpl.setDebugPatterns
public void setDebugPatterns(String patterns) { _patterns=patterns; if (patterns!=null && patterns.length()>0) { _debugPatterns = new ArrayList(); StringTokenizer tok = new StringTokenizer(patterns,", \t"); while (tok.hasMoreTokens()) { ...
java
public void setDebugPatterns(String patterns) { _patterns=patterns; if (patterns!=null && patterns.length()>0) { _debugPatterns = new ArrayList(); StringTokenizer tok = new StringTokenizer(patterns,", \t"); while (tok.hasMoreTokens()) { ...
[ "public", "void", "setDebugPatterns", "(", "String", "patterns", ")", "{", "_patterns", "=", "patterns", ";", "if", "(", "patterns", "!=", "null", "&&", "patterns", ".", "length", "(", ")", ">", "0", ")", "{", "_debugPatterns", "=", "new", "ArrayList", "...
Set debug patterns. @param patterns comma separated string of patterns
[ "Set", "debug", "patterns", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/LogImpl.java#L479-L495
100,712
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java
UrlEncoded.encode
public synchronized String encode(String charset, boolean equalsForNullValue) { if (charset==null) charset=StringUtil.__ISO_8859_1; StringBuffer result = new StringBuffer(128); synchronized(result) { Iterator iter = entrySet().iterator(); ...
java
public synchronized String encode(String charset, boolean equalsForNullValue) { if (charset==null) charset=StringUtil.__ISO_8859_1; StringBuffer result = new StringBuffer(128); synchronized(result) { Iterator iter = entrySet().iterator(); ...
[ "public", "synchronized", "String", "encode", "(", "String", "charset", ",", "boolean", "equalsForNullValue", ")", "{", "if", "(", "charset", "==", "null", ")", "charset", "=", "StringUtil", ".", "__ISO_8859_1", ";", "StringBuffer", "result", "=", "new", "Stri...
Encode Hashtable with % encoding. @param equalsForNullValue if True, then an '=' is always used, even for parameters without a value. e.g. "blah?a=&b=&c=".
[ "Encode", "Hashtable", "with", "%", "encoding", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java#L104-L156
100,713
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java
UrlEncoded.decodeString
public static String decodeString(String encoded) { return decodeString(encoded,0,encoded.length(),StringUtil.__ISO_8859_1); }
java
public static String decodeString(String encoded) { return decodeString(encoded,0,encoded.length(),StringUtil.__ISO_8859_1); }
[ "public", "static", "String", "decodeString", "(", "String", "encoded", ")", "{", "return", "decodeString", "(", "encoded", ",", "0", ",", "encoded", ".", "length", "(", ")", ",", "StringUtil", ".", "__ISO_8859_1", ")", ";", "}" ]
Decode String with % encoding. This method makes the assumption that the majority of calls will need no decoding and uses the 8859 encoding.
[ "Decode", "String", "with", "%", "encoding", ".", "This", "method", "makes", "the", "assumption", "that", "the", "majority", "of", "calls", "will", "need", "no", "decoding", "and", "uses", "the", "8859", "encoding", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/UrlEncoded.java#L311-L314
100,714
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java
OnlineUpdateUASparser.checkDataMaps
@Override protected synchronized void checkDataMaps() throws IOException { if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) { String versionOnServer = getVersionFromServer(); if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) { loadDataFro...
java
@Override protected synchronized void checkDataMaps() throws IOException { if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) { String versionOnServer = getVersionFromServer(); if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) { loadDataFro...
[ "@", "Override", "protected", "synchronized", "void", "checkDataMaps", "(", ")", "throws", "IOException", "{", "if", "(", "lastUpdateCheck", "==", "0", "||", "lastUpdateCheck", "<", "System", ".", "currentTimeMillis", "(", ")", "-", "updateInterval", ")", "{", ...
Since we've online access to the data file, we check every day for an update
[ "Since", "we", "ve", "online", "access", "to", "the", "data", "file", "we", "check", "every", "day", "for", "an", "update" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L30-L40
100,715
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java
OnlineUpdateUASparser.loadDataFromInternet
private void loadDataFromInternet() throws IOException { URL url = new URL(DATA_RETRIVE_URL); InputStream is = url.openStream(); try { PHPFileParser fp = new PHPFileParser(is); createInternalDataStructre(fp.getSections()); } finally { is.close(); } }
java
private void loadDataFromInternet() throws IOException { URL url = new URL(DATA_RETRIVE_URL); InputStream is = url.openStream(); try { PHPFileParser fp = new PHPFileParser(is); createInternalDataStructre(fp.getSections()); } finally { is.close(); } }
[ "private", "void", "loadDataFromInternet", "(", ")", "throws", "IOException", "{", "URL", "url", "=", "new", "URL", "(", "DATA_RETRIVE_URL", ")", ";", "InputStream", "is", "=", "url", ".", "openStream", "(", ")", ";", "try", "{", "PHPFileParser", "fp", "="...
Loads the data file from user-agent-string.info @throws IOException
[ "Loads", "the", "data", "file", "from", "user", "-", "agent", "-", "string", ".", "info" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L47-L56
100,716
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java
OnlineUpdateUASparser.getVersionFromServer
protected String getVersionFromServer() throws IOException { URL url = new URL(VERSION_CHECK_URL); InputStream is = url.openStream(); try { byte[] buff = new byte[4048]; int len = is.read(buff); return new String(buff, 0, len); } finally { is.close(); } }
java
protected String getVersionFromServer() throws IOException { URL url = new URL(VERSION_CHECK_URL); InputStream is = url.openStream(); try { byte[] buff = new byte[4048]; int len = is.read(buff); return new String(buff, 0, len); } finally { is.close(); } }
[ "protected", "String", "getVersionFromServer", "(", ")", "throws", "IOException", "{", "URL", "url", "=", "new", "URL", "(", "VERSION_CHECK_URL", ")", ";", "InputStream", "is", "=", "url", ".", "openStream", "(", ")", ";", "try", "{", "byte", "[", "]", "...
Gets the current version from user-agent-string.info @return @throws IOException
[ "Gets", "the", "current", "version", "from", "user", "-", "agent", "-", "string", ".", "info" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/OnlineUpdateUASparser.java#L64-L74
100,717
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LazyList.java
LazyList.add
public static Object add(Object list, Object item) { if (list==null) { if (item instanceof List || item==null) { List l = new ArrayList(); l.add(item); return l; } return item; } if (lis...
java
public static Object add(Object list, Object item) { if (list==null) { if (item instanceof List || item==null) { List l = new ArrayList(); l.add(item); return l; } return item; } if (lis...
[ "public", "static", "Object", "add", "(", "Object", "list", ",", "Object", "item", ")", "{", "if", "(", "list", "==", "null", ")", "{", "if", "(", "item", "instanceof", "List", "||", "item", "==", "null", ")", "{", "List", "l", "=", "new", "ArrayLi...
Add an item to a LazyList @param list The list to add to or null if none yet created. @param item The item to add. @return The lazylist created or added to.
[ "Add", "an", "item", "to", "a", "LazyList" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LazyList.java#L61-L85
100,718
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LazyList.java
LazyList.add
protected Object add(Object list, Collection collection) { Iterator i=collection.iterator(); while(i.hasNext()) list=LazyList.add(list,i.next()); return list; }
java
protected Object add(Object list, Collection collection) { Iterator i=collection.iterator(); while(i.hasNext()) list=LazyList.add(list,i.next()); return list; }
[ "protected", "Object", "add", "(", "Object", "list", ",", "Collection", "collection", ")", "{", "Iterator", "i", "=", "collection", ".", "iterator", "(", ")", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "list", "=", "LazyList", ".", "add", ...
Add the contents of a Collection to a LazyList @param list The list to add to or null if none yet created. @param collection The Collection whose contents should be added. @return The lazylist created or added to. @deprecated Use addCollection
[ "Add", "the", "contents", "of", "a", "Collection", "to", "a", "LazyList" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LazyList.java#L127-L133
100,719
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java
StringUtil.indexFrom
public static int indexFrom(String s,String chars) { for (int i=0;i<s.length();i++) if (chars.indexOf(s.charAt(i))>=0) return i; return -1; }
java
public static int indexFrom(String s,String chars) { for (int i=0;i<s.length();i++) if (chars.indexOf(s.charAt(i))>=0) return i; return -1; }
[ "public", "static", "int", "indexFrom", "(", "String", "s", ",", "String", "chars", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "length", "(", ")", ";", "i", "++", ")", "if", "(", "chars", ".", "indexOf", "(", "s", "....
returns the next index of a character from the chars string
[ "returns", "the", "next", "index", "of", "a", "character", "from", "the", "chars", "string" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java#L170-L176
100,720
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java
StringUtil.replace
public static String replace(String s, String sub, String with) { int c=0; int i=s.indexOf(sub,c); if (i == -1) return s; StringBuffer buf = new StringBuffer(s.length()+with.length()); synchronized(buf) { do { ...
java
public static String replace(String s, String sub, String with) { int c=0; int i=s.indexOf(sub,c); if (i == -1) return s; StringBuffer buf = new StringBuffer(s.length()+with.length()); synchronized(buf) { do { ...
[ "public", "static", "String", "replace", "(", "String", "s", ",", "String", "sub", ",", "String", "with", ")", "{", "int", "c", "=", "0", ";", "int", "i", "=", "s", ".", "indexOf", "(", "sub", ",", "c", ")", ";", "if", "(", "i", "==", "-", "1...
replace substrings within string.
[ "replace", "substrings", "within", "string", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/StringUtil.java#L182-L205
100,721
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Element.java
Element.setAttributesFrom
public Element setAttributesFrom(Element e) { attributes=e.attributes; attributeMap=(Hashtable)e.attributeMap.clone(); return this; }
java
public Element setAttributesFrom(Element e) { attributes=e.attributes; attributeMap=(Hashtable)e.attributeMap.clone(); return this; }
[ "public", "Element", "setAttributesFrom", "(", "Element", "e", ")", "{", "attributes", "=", "e", ".", "attributes", ";", "attributeMap", "=", "(", "Hashtable", ")", "e", ".", "attributeMap", ".", "clone", "(", ")", ";", "return", "this", ";", "}" ]
Set attributes from another Element. @param e Element @return This Element
[ "Set", "attributes", "from", "another", "Element", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Element.java#L199-L204
100,722
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Pool.java
Pool.setPoolClass
public void setPoolClass(Class poolClass) throws IllegalStateException { synchronized(this) { if (_class!=poolClass) { if (_running>0) throw new IllegalStateException("Thread Pool Running"); if (!PondLife.class.isAss...
java
public void setPoolClass(Class poolClass) throws IllegalStateException { synchronized(this) { if (_class!=poolClass) { if (_running>0) throw new IllegalStateException("Thread Pool Running"); if (!PondLife.class.isAss...
[ "public", "void", "setPoolClass", "(", "Class", "poolClass", ")", "throws", "IllegalStateException", "{", "synchronized", "(", "this", ")", "{", "if", "(", "_class", "!=", "poolClass", ")", "{", "if", "(", "_running", ">", "0", ")", "throw", "new", "Illega...
Set the class. @param poolClass The class @exception IllegalStateException If the pool has already been started.
[ "Set", "the", "class", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Pool.java#L121-L136
100,723
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.compareTo
public int compareTo(Object o) { if (o instanceof ServletHolder) { ServletHolder sh= (ServletHolder)o; if (sh==this) return 0; if (sh._initOrder<_initOrder) return 1; if (sh._initOrder>_initOrder) return ...
java
public int compareTo(Object o) { if (o instanceof ServletHolder) { ServletHolder sh= (ServletHolder)o; if (sh==this) return 0; if (sh._initOrder<_initOrder) return 1; if (sh._initOrder>_initOrder) return ...
[ "public", "int", "compareTo", "(", "Object", "o", ")", "{", "if", "(", "o", "instanceof", "ServletHolder", ")", "{", "ServletHolder", "sh", "=", "(", "ServletHolder", ")", "o", ";", "if", "(", "sh", "==", "this", ")", "return", "0", ";", "if", "(", ...
Comparitor by init order.
[ "Comparitor", "by", "init", "order", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L124-L143
100,724
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.setUserRoleLink
public synchronized void setUserRoleLink(String name,String link) { if (_roleMap==null) _roleMap=new HashMap(); _roleMap.put(name,link); }
java
public synchronized void setUserRoleLink(String name,String link) { if (_roleMap==null) _roleMap=new HashMap(); _roleMap.put(name,link); }
[ "public", "synchronized", "void", "setUserRoleLink", "(", "String", "name", ",", "String", "link", ")", "{", "if", "(", "_roleMap", "==", "null", ")", "_roleMap", "=", "new", "HashMap", "(", ")", ";", "_roleMap", ".", "put", "(", "name", ",", "link", "...
Link a user role. Translate the role name used by a servlet, to the link name used by the container. @param name The role name as used by the servlet @param link The role name as used by the container.
[ "Link", "a", "user", "role", ".", "Translate", "the", "role", "name", "used", "by", "a", "servlet", "to", "the", "link", "name", "used", "by", "the", "container", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L170-L175
100,725
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.getUserRoleLink
public String getUserRoleLink(String name) { if (_roleMap==null) return name; String link=(String)_roleMap.get(name); return (link==null)?name:link; }
java
public String getUserRoleLink(String name) { if (_roleMap==null) return name; String link=(String)_roleMap.get(name); return (link==null)?name:link; }
[ "public", "String", "getUserRoleLink", "(", "String", "name", ")", "{", "if", "(", "_roleMap", "==", "null", ")", "return", "name", ";", "String", "link", "=", "(", "String", ")", "_roleMap", ".", "get", "(", "name", ")", ";", "return", "(", "link", ...
get a user role link. @param name The name of the role @return The name as translated by the link. If no link exists, the name is returned.
[ "get", "a", "user", "role", "link", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L183-L189
100,726
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.getServlet
public synchronized Servlet getServlet() throws ServletException { // Handle previous unavailability if (_unavailable!=0) { if (_unavailable<0 || _unavailable>0 && System.currentTimeMillis()<_unavailable) throw _unavailableEx; _unavailable=0; ...
java
public synchronized Servlet getServlet() throws ServletException { // Handle previous unavailability if (_unavailable!=0) { if (_unavailable<0 || _unavailable>0 && System.currentTimeMillis()<_unavailable) throw _unavailableEx; _unavailable=0; ...
[ "public", "synchronized", "Servlet", "getServlet", "(", ")", "throws", "ServletException", "{", "// Handle previous unavailability", "if", "(", "_unavailable", "!=", "0", ")", "{", "if", "(", "_unavailable", "<", "0", "||", "_unavailable", ">", "0", "&&", "Syste...
Get the servlet. @return The servlet
[ "Get", "the", "servlet", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L287-L345
100,727
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java
ServletHolder.handle
public void handle(ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException { if (_class==null) throw new UnavailableException("Servlet Not Initialized"); Servlet ser...
java
public void handle(ServletRequest request, ServletResponse response) throws ServletException, UnavailableException, IOException { if (_class==null) throw new UnavailableException("Servlet Not Initialized"); Servlet ser...
[ "public", "void", "handle", "(", "ServletRequest", "request", ",", "ServletResponse", "response", ")", "throws", "ServletException", ",", "UnavailableException", ",", "IOException", "{", "if", "(", "_class", "==", "null", ")", "throw", "new", "UnavailableException",...
Service a request with this servlet.
[ "Service", "a", "request", "with", "this", "servlet", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHolder.java#L389-L450
100,728
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java
FrameSet.nameFrame
public Frame nameFrame(String name,int col, int row) { if (frameMap==null) { frameMap=new Hashtable(10); frameNames=new Vector(10); } Frame frame = frames[col][row]; if (frame==null) frame = frames[col][row] = new Frame(); ...
java
public Frame nameFrame(String name,int col, int row) { if (frameMap==null) { frameMap=new Hashtable(10); frameNames=new Vector(10); } Frame frame = frames[col][row]; if (frame==null) frame = frames[col][row] = new Frame(); ...
[ "public", "Frame", "nameFrame", "(", "String", "name", ",", "int", "col", ",", "int", "row", ")", "{", "if", "(", "frameMap", "==", "null", ")", "{", "frameMap", "=", "new", "Hashtable", "(", "10", ")", ";", "frameNames", "=", "new", "Vector", "(", ...
Name a frame. By convention, frame names match Page section names
[ "Name", "a", "frame", ".", "By", "convention", "frame", "names", "match", "Page", "section", "names" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/FrameSet.java#L116-L134
100,729
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java
HashUserRealm.load
public void load(String config) throws IOException { _config=config; if(log.isDebugEnabled())log.debug("Load "+this+" from "+config); Properties properties = new Properties(); Resource resource=Resource.newResource(config); properties.load(resource.getInputStream()); ...
java
public void load(String config) throws IOException { _config=config; if(log.isDebugEnabled())log.debug("Load "+this+" from "+config); Properties properties = new Properties(); Resource resource=Resource.newResource(config); properties.load(resource.getInputStream()); ...
[ "public", "void", "load", "(", "String", "config", ")", "throws", "IOException", "{", "_config", "=", "config", ";", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "log", ".", "debug", "(", "\"Load \"", "+", "this", "+", "\" from \"", "+", "co...
Load realm users from properties file. The property file maps usernames to password specs followed by an optional comma separated list of role names. @param config Filename or url of user properties file. @exception IOException
[ "Load", "realm", "users", "from", "properties", "file", ".", "The", "property", "file", "maps", "usernames", "to", "password", "specs", "followed", "by", "an", "optional", "comma", "separated", "list", "of", "role", "names", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L127-L163
100,730
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java
HashUserRealm.put
public synchronized Object put(Object name, Object credentials) { if (credentials instanceof Principal) return super.put(name.toString(), credentials); if (credentials instanceof Password) return super.put(name, ...
java
public synchronized Object put(Object name, Object credentials) { if (credentials instanceof Principal) return super.put(name.toString(), credentials); if (credentials instanceof Password) return super.put(name, ...
[ "public", "synchronized", "Object", "put", "(", "Object", "name", ",", "Object", "credentials", ")", "{", "if", "(", "credentials", "instanceof", "Principal", ")", "return", "super", ".", "put", "(", "name", ".", "toString", "(", ")", ",", "credentials", "...
Put user into realm. @param name User name @param credentials String password, Password or UserPrinciple instance. @return Old UserPrinciple value or null
[ "Put", "user", "into", "realm", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L236-L252
100,731
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java
HashUserRealm.addUserToRole
public synchronized void addUserToRole(String userName, String roleName) { HashSet userSet = (HashSet)_roles.get(roleName); if (userSet==null) { userSet=new HashSet(11); _roles.put(roleName,userSet); } userSet.add(userName); }
java
public synchronized void addUserToRole(String userName, String roleName) { HashSet userSet = (HashSet)_roles.get(roleName); if (userSet==null) { userSet=new HashSet(11); _roles.put(roleName,userSet); } userSet.add(userName); }
[ "public", "synchronized", "void", "addUserToRole", "(", "String", "userName", ",", "String", "roleName", ")", "{", "HashSet", "userSet", "=", "(", "HashSet", ")", "_roles", ".", "get", "(", "roleName", ")", ";", "if", "(", "userSet", "==", "null", ")", "...
Add a user to a role. @param userName @param roleName
[ "Add", "a", "user", "to", "a", "role", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L259-L268
100,732
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java
HashUserRealm.isUserInRole
public synchronized boolean isUserInRole(Principal user, String roleName) { if (user instanceof WrappedUser) return ((WrappedUser)user).isUserInRole(roleName); if (user==null || ((User)user).getUserRealm()!=this) return false; HashSet userSet = (Has...
java
public synchronized boolean isUserInRole(Principal user, String roleName) { if (user instanceof WrappedUser) return ((WrappedUser)user).isUserInRole(roleName); if (user==null || ((User)user).getUserRealm()!=this) return false; HashSet userSet = (Has...
[ "public", "synchronized", "boolean", "isUserInRole", "(", "Principal", "user", ",", "String", "roleName", ")", "{", "if", "(", "user", "instanceof", "WrappedUser", ")", "return", "(", "(", "WrappedUser", ")", "user", ")", ".", "isUserInRole", "(", "roleName", ...
Check if a user is in a role. @param user The user, which must be from this realm @param roleName @return True if the user can act in the role.
[ "Check", "if", "a", "user", "is", "in", "a", "role", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HashUserRealm.java#L282-L292
100,733
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/FileResource.java
FileResource.list
public String[] list() { String[] list =_file.list(); if (list==null) return null; for (int i=list.length;i-->0;) { if (new File(_file,list[i]).isDirectory() && !list[i].endsWith("/")) list[i]+="/"; } return list...
java
public String[] list() { String[] list =_file.list(); if (list==null) return null; for (int i=list.length;i-->0;) { if (new File(_file,list[i]).isDirectory() && !list[i].endsWith("/")) list[i]+="/"; } return list...
[ "public", "String", "[", "]", "list", "(", ")", "{", "String", "[", "]", "list", "=", "_file", ".", "list", "(", ")", ";", "if", "(", "list", "==", "null", ")", "return", "null", ";", "for", "(", "int", "i", "=", "list", ".", "length", ";", "...
Returns a list of resources contained in the given resource
[ "Returns", "a", "list", "of", "resources", "contained", "in", "the", "given", "resource" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/FileResource.java#L292-L304
100,734
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.mapPathToServlet
public ServletHolder mapPathToServlet(String pathSpec, String servletName) { ServletHolder holder =(ServletHolder)_nameMap.get(servletName); if (!pathSpec.startsWith("/") && !pathSpec.startsWith("*")) { log.warn("pathSpec should start wi...
java
public ServletHolder mapPathToServlet(String pathSpec, String servletName) { ServletHolder holder =(ServletHolder)_nameMap.get(servletName); if (!pathSpec.startsWith("/") && !pathSpec.startsWith("*")) { log.warn("pathSpec should start wi...
[ "public", "ServletHolder", "mapPathToServlet", "(", "String", "pathSpec", ",", "String", "servletName", ")", "{", "ServletHolder", "holder", "=", "(", "ServletHolder", ")", "_nameMap", ".", "get", "(", "servletName", ")", ";", "if", "(", "!", "pathSpec", ".", ...
Map a servlet to a pathSpec @param pathSpec The pathspec to map @param servletName The name of the servlet, which must have already been added. @return The servlet holder of the mapped servlet.
[ "Map", "a", "servlet", "to", "a", "pathSpec" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L272-L287
100,735
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.addServletHolder
public void addServletHolder(ServletHolder holder) { ServletHolder existing = (ServletHolder) _nameMap.get(holder.getName()); if (existing==null) _nameMap.put(holder.getName(),holder); else if (existing!=holder) throw new IllegalArgumentException("Holder alrea...
java
public void addServletHolder(ServletHolder holder) { ServletHolder existing = (ServletHolder) _nameMap.get(holder.getName()); if (existing==null) _nameMap.put(holder.getName(),holder); else if (existing!=holder) throw new IllegalArgumentException("Holder alrea...
[ "public", "void", "addServletHolder", "(", "ServletHolder", "holder", ")", "{", "ServletHolder", "existing", "=", "(", "ServletHolder", ")", "_nameMap", ".", "get", "(", "holder", ".", "getName", "(", ")", ")", ";", "if", "(", "existing", "==", "null", ")"...
Register an existing ServletHolder with this handler. @param holder the ServletHolder to register.
[ "Register", "an", "existing", "ServletHolder", "with", "this", "handler", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L349-L358
100,736
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.getServlets
public ServletHolder[] getServlets() { // Sort and Initialize servlets HashSet holder_set = new HashSet(_nameMap.size()); holder_set.addAll(_nameMap.values()); ServletHolder holders [] = (ServletHolder []) holder_set.toArray(new ServletHolder [holder_set.size()]); ...
java
public ServletHolder[] getServlets() { // Sort and Initialize servlets HashSet holder_set = new HashSet(_nameMap.size()); holder_set.addAll(_nameMap.values()); ServletHolder holders [] = (ServletHolder []) holder_set.toArray(new ServletHolder [holder_set.size()]); ...
[ "public", "ServletHolder", "[", "]", "getServlets", "(", ")", "{", "// Sort and Initialize servlets", "HashSet", "holder_set", "=", "new", "HashSet", "(", "_nameMap", ".", "size", "(", ")", ")", ";", "holder_set", ".", "addAll", "(", "_nameMap", ".", "values",...
Get Servlets. @return Array of defined servlets
[ "Get", "Servlets", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L398-L407
100,737
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.initializeServlets
public void initializeServlets() throws Exception { MultiException mx = new MultiException(); // Sort and Initialize servlets ServletHolder[] holders = getServlets(); for (int i=0; i<holders.length; i++) { try{holders[i].start();} catc...
java
public void initializeServlets() throws Exception { MultiException mx = new MultiException(); // Sort and Initialize servlets ServletHolder[] holders = getServlets(); for (int i=0; i<holders.length; i++) { try{holders[i].start();} catc...
[ "public", "void", "initializeServlets", "(", ")", "throws", "Exception", "{", "MultiException", "mx", "=", "new", "MultiException", "(", ")", ";", "// Sort and Initialize servlets", "ServletHolder", "[", "]", "holders", "=", "getServlets", "(", ")", ";", "for", ...
Initialize load-on-startup servlets. Called automatically from start if autoInitializeServlet is true.
[ "Initialize", "load", "-", "on", "-", "startup", "servlets", ".", "Called", "automatically", "from", "start", "if", "autoInitializeServlet", "is", "true", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L413-L430
100,738
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.getResource
public URL getResource(String uriInContext) throws MalformedURLException { if (uriInContext==null || !uriInContext.startsWith("/")) throw new MalformedURLException(uriInContext); try{ Resource resource = getHttpContext().getResource(uriInContext); ...
java
public URL getResource(String uriInContext) throws MalformedURLException { if (uriInContext==null || !uriInContext.startsWith("/")) throw new MalformedURLException(uriInContext); try{ Resource resource = getHttpContext().getResource(uriInContext); ...
[ "public", "URL", "getResource", "(", "String", "uriInContext", ")", "throws", "MalformedURLException", "{", "if", "(", "uriInContext", "==", "null", "||", "!", "uriInContext", ".", "startsWith", "(", "\"/\"", ")", ")", "throw", "new", "MalformedURLException", "(...
Get a Resource. If no resource is found, resource aliases are tried. @param uriInContext @return URL of the resource. @exception MalformedURLException
[ "Get", "a", "Resource", ".", "If", "no", "resource", "is", "found", "resource", "aliases", "are", "tried", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L704-L728
100,739
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.getNamedDispatcher
public RequestDispatcher getNamedDispatcher(String name) { if (name == null || name.length()==0) name=__DEFAULT_SERVLET; try { return new Dispatcher(ServletHandler.this,name); } catch(Exception e) {LogSupport.ignore(log,e);} return null; }
java
public RequestDispatcher getNamedDispatcher(String name) { if (name == null || name.length()==0) name=__DEFAULT_SERVLET; try { return new Dispatcher(ServletHandler.this,name); } catch(Exception e) {LogSupport.ignore(log,e);} return null; }
[ "public", "RequestDispatcher", "getNamedDispatcher", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "name", "=", "__DEFAULT_SERVLET", ";", "try", "{", "return", "new", "Dispatcher", ...
Get Named dispatcher. @param name The name of the servlet. If null or empty string, the containers default servlet is returned. @return Request dispatcher for the named servlet.
[ "Get", "Named", "dispatcher", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L821-L830
100,740
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.getContextAttribute
protected Object getContextAttribute(String name) { if (ServletHandler.__J_S_CONTEXT_TEMPDIR.equals(name)) { // Initialize temporary directory Object t = getHttpContext().getAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR); if (t instanceof File) r...
java
protected Object getContextAttribute(String name) { if (ServletHandler.__J_S_CONTEXT_TEMPDIR.equals(name)) { // Initialize temporary directory Object t = getHttpContext().getAttribute(ServletHandler.__J_S_CONTEXT_TEMPDIR); if (t instanceof File) r...
[ "protected", "Object", "getContextAttribute", "(", "String", "name", ")", "{", "if", "(", "ServletHandler", ".", "__J_S_CONTEXT_TEMPDIR", ".", "equals", "(", "name", ")", ")", "{", "// Initialize temporary directory", "Object", "t", "=", "getHttpContext", "(", ")"...
Get context attribute. Tries ServletHandler attributes and then delegated to HttpContext. @param name attribute name. @return attribute
[ "Get", "context", "attribute", ".", "Tries", "ServletHandler", "attributes", "and", "then", "delegated", "to", "HttpContext", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L906-L922
100,741
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java
ServletHandler.getContextAttributeNames
protected Enumeration getContextAttributeNames() { if (_attributes.size()==0) return getHttpContext().getAttributeNames(); HashSet set=new HashSet(_attributes.keySet()); Enumeration e=getHttpContext().getAttributeNames(); while(e.hasMoreElements()) set.add(e.n...
java
protected Enumeration getContextAttributeNames() { if (_attributes.size()==0) return getHttpContext().getAttributeNames(); HashSet set=new HashSet(_attributes.keySet()); Enumeration e=getHttpContext().getAttributeNames(); while(e.hasMoreElements()) set.add(e.n...
[ "protected", "Enumeration", "getContextAttributeNames", "(", ")", "{", "if", "(", "_attributes", ".", "size", "(", ")", "==", "0", ")", "return", "getHttpContext", "(", ")", ".", "getAttributeNames", "(", ")", ";", "HashSet", "set", "=", "new", "HashSet", ...
Get context attribute names. Combines ServletHandler and HttpContext attributes.
[ "Get", "context", "attribute", "names", ".", "Combines", "ServletHandler", "and", "HttpContext", "attributes", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHandler.java#L928-L937
100,742
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java
XmlConfiguration.configure
public void configure(Object obj) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { //Check the class of the object Class oClass = nodeClass(_config); if (oClass != null) { if (obj...
java
public void configure(Object obj) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { //Check the class of the object Class oClass = nodeClass(_config); if (oClass != null) { if (obj...
[ "public", "void", "configure", "(", "Object", "obj", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "InvocationTargetException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "//Check the class of the object", "Class", "oClass...
Configure an object. If the object is of the approprate class, the XML configuration script is applied to the object. @param obj The object to be configured. @exception ClassNotFoundException @exception NoSuchMethodException @exception InvocationTargetException @throws IllegalAccessException @throws InstantiationExcep...
[ "Configure", "an", "object", ".", "If", "the", "object", "is", "of", "the", "approprate", "class", "the", "XML", "configuration", "script", "is", "applied", "to", "the", "object", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java#L158-L170
100,743
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java
XmlConfiguration.newInstance
public Object newInstance() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { Class oClass = nodeClass(_config); Object obj = null; if (oClass != null) obj = oClass.newInstance(); configure(ob...
java
public Object newInstance() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException { Class oClass = nodeClass(_config); Object obj = null; if (oClass != null) obj = oClass.newInstance(); configure(ob...
[ "public", "Object", "newInstance", "(", ")", "throws", "ClassNotFoundException", ",", "NoSuchMethodException", ",", "InvocationTargetException", ",", "InstantiationException", ",", "IllegalAccessException", "{", "Class", "oClass", "=", "nodeClass", "(", "_config", ")", ...
Create a new object and configure it. A new object is created and configured. @return The newly created configured object. @exception ClassNotFoundException @exception NoSuchMethodException @exception InvocationTargetException @exception InstantiationException @exception IllegalAccessException
[ "Create", "a", "new", "object", "and", "configure", "it", ".", "A", "new", "object", "is", "created", "and", "configured", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/xml/XmlConfiguration.java#L183-L191
100,744
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/JettyWebConfiguration.java
JettyWebConfiguration.configureWebApp
public void configureWebApp () throws Exception { //cannot configure if the _context is already started if (_context.isStarted()) { if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");}; return; } if(log.isDebugE...
java
public void configureWebApp () throws Exception { //cannot configure if the _context is already started if (_context.isStarted()) { if (log.isDebugEnabled()){log.debug("Cannot configure webapp after it is started");}; return; } if(log.isDebugE...
[ "public", "void", "configureWebApp", "(", ")", "throws", "Exception", "{", "//cannot configure if the _context is already started", "if", "(", "_context", ".", "isStarted", "(", ")", ")", "{", "if", "(", "log", ".", "isDebugEnabled", "(", ")", ")", "{", "log", ...
configureWebApp Apply web-jetty.xml configuration @see org.browsermob.proxy.jetty.jetty.servlet.WebApplicationContext.Configuration#configureWebApp()
[ "configureWebApp", "Apply", "web", "-", "jetty", ".", "xml", "configuration" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/JettyWebConfiguration.java#L72-L119
100,745
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java
HttpContext.addVirtualHost
public void addVirtualHost(String hostname) { // Note that null hosts are also added. if (!_vhosts.contains(hostname)) { _vhosts.add(hostname); _contextName=null; if (_httpServer!=null) { if (_vhosts.size()==1) ...
java
public void addVirtualHost(String hostname) { // Note that null hosts are also added. if (!_vhosts.contains(hostname)) { _vhosts.add(hostname); _contextName=null; if (_httpServer!=null) { if (_vhosts.size()==1) ...
[ "public", "void", "addVirtualHost", "(", "String", "hostname", ")", "{", "// Note that null hosts are also added.", "if", "(", "!", "_vhosts", ".", "contains", "(", "hostname", ")", ")", "{", "_vhosts", ".", "add", "(", "hostname", ")", ";", "_contextName", "=...
Add a virtual host alias to this context. @see #setVirtualHosts @param hostname A hostname. A null host name means any hostname is acceptable. Host names may String representation of IP addresses.
[ "Add", "a", "virtual", "host", "alias", "to", "this", "context", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java#L272-L288
100,746
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java
HttpContext.removeVirtualHost
public void removeVirtualHost(String hostname) { // Note that null hosts are also added. if (_vhosts.remove(hostname)) { _contextName=null; if (_httpServer!=null) { _httpServer.removeMapping(hostname,this); if (_vhosts.size(...
java
public void removeVirtualHost(String hostname) { // Note that null hosts are also added. if (_vhosts.remove(hostname)) { _contextName=null; if (_httpServer!=null) { _httpServer.removeMapping(hostname,this); if (_vhosts.size(...
[ "public", "void", "removeVirtualHost", "(", "String", "hostname", ")", "{", "// Note that null hosts are also added.", "if", "(", "_vhosts", ".", "remove", "(", "hostname", ")", ")", "{", "_contextName", "=", "null", ";", "if", "(", "_httpServer", "!=", "null", ...
remove a virtual host alias to this context. @see #setVirtualHosts @param hostname A hostname. A null host name means any hostname is acceptable. Host names may String representation of IP addresses.
[ "remove", "a", "virtual", "host", "alias", "to", "this", "context", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpContext.java#L296-L310
100,747
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java
ByteBufferOutputStream.prewrite
public void prewrite(byte[] b) { ensureReserve(b.length); System.arraycopy(b,0,_buf,_start-b.length,b.length); _start-=b.length; }
java
public void prewrite(byte[] b) { ensureReserve(b.length); System.arraycopy(b,0,_buf,_start-b.length,b.length); _start-=b.length; }
[ "public", "void", "prewrite", "(", "byte", "[", "]", "b", ")", "{", "ensureReserve", "(", "b", ".", "length", ")", ";", "System", ".", "arraycopy", "(", "b", ",", "0", ",", "_buf", ",", "_start", "-", "b", ".", "length", ",", "b", ".", "length", ...
Write byte array to start of the buffer. @param b
[ "Write", "byte", "array", "to", "start", "of", "the", "buffer", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L217-L222
100,748
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java
ByteBufferOutputStream.prewrite
public void prewrite(byte[] b,int offset, int length) { ensureReserve(length); System.arraycopy(b,offset,_buf,_start-length,length); _start-=length; }
java
public void prewrite(byte[] b,int offset, int length) { ensureReserve(length); System.arraycopy(b,offset,_buf,_start-length,length); _start-=length; }
[ "public", "void", "prewrite", "(", "byte", "[", "]", "b", ",", "int", "offset", ",", "int", "length", ")", "{", "ensureReserve", "(", "length", ")", ";", "System", ".", "arraycopy", "(", "b", ",", "offset", ",", "_buf", ",", "_start", "-", "length", ...
Write byte range to start of the buffer. @param b @param offset @param length
[ "Write", "byte", "range", "to", "start", "of", "the", "buffer", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L230-L235
100,749
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java
ByteBufferOutputStream.postwrite
public void postwrite(byte[] b,int offset, int length) throws IOException { System.arraycopy(b,offset,_buf,_pos,length); _pos+=length; }
java
public void postwrite(byte[] b,int offset, int length) throws IOException { System.arraycopy(b,offset,_buf,_pos,length); _pos+=length; }
[ "public", "void", "postwrite", "(", "byte", "[", "]", "b", ",", "int", "offset", ",", "int", "length", ")", "throws", "IOException", "{", "System", ".", "arraycopy", "(", "b", ",", "offset", ",", "_buf", ",", "_pos", ",", "length", ")", ";", "_pos", ...
Write bytes into the postreserve. The capacity is not checked. @param b @param offset @param length @exception IOException
[ "Write", "bytes", "into", "the", "postreserve", ".", "The", "capacity", "is", "not", "checked", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteBufferOutputStream.java#L259-L264
100,750
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java
AJP13Listener.createConnection
protected AJP13Connection createConnection(Socket socket) throws IOException { return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize()); }
java
protected AJP13Connection createConnection(Socket socket) throws IOException { return new AJP13Connection(this,socket.getInputStream(),socket.getOutputStream(),socket,getBufferSize()); }
[ "protected", "AJP13Connection", "createConnection", "(", "Socket", "socket", ")", "throws", "IOException", "{", "return", "new", "AJP13Connection", "(", "this", ",", "socket", ".", "getInputStream", "(", ")", ",", "socket", ".", "getOutputStream", "(", ")", ",",...
Create an AJP13Connection instance. This method can be used to override the connection instance. @param socket The underlying socket.
[ "Create", "an", "AJP13Connection", "instance", ".", "This", "method", "can", "be", "used", "to", "override", "the", "connection", "instance", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/ajp/AJP13Listener.java#L223-L226
100,751
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Link.java
Link.target
public Link target(String t) { if (t!=null && t.length()>0) attribute("target",t); return this; }
java
public Link target(String t) { if (t!=null && t.length()>0) attribute("target",t); return this; }
[ "public", "Link", "target", "(", "String", "t", ")", "{", "if", "(", "t", "!=", "null", "&&", "t", ".", "length", "(", ")", ">", "0", ")", "attribute", "(", "\"target\"", ",", "t", ")", ";", "return", "this", ";", "}" ]
Set the link target frame.
[ "Set", "the", "link", "target", "frame", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Link.java#L51-L56
100,752
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Applet.java
Applet.write
public void write(Writer out) throws IOException { if (codeBase != null) attribute("codebase",codeBase); if (debug) paramHolder.add("<param name=\"debug\" value=\"yes\">"); if (params != null) for (Enumeration enm = params.keys(); enm.has...
java
public void write(Writer out) throws IOException { if (codeBase != null) attribute("codebase",codeBase); if (debug) paramHolder.add("<param name=\"debug\" value=\"yes\">"); if (params != null) for (Enumeration enm = params.keys(); enm.has...
[ "public", "void", "write", "(", "Writer", "out", ")", "throws", "IOException", "{", "if", "(", "codeBase", "!=", "null", ")", "attribute", "(", "\"codebase\"", ",", "codeBase", ")", ";", "if", "(", "debug", ")", "paramHolder", ".", "add", "(", "\"<param ...
Write out the HTML
[ "Write", "out", "the", "HTML" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Applet.java#L123-L139
100,753
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.add
public Composite add(Object o) { if (nest!=null) nest.add(o); else { if (o!=null) { if (o instanceof Element) { if(o instanceof Page) throw new IllegalArgumentException("Can't inse...
java
public Composite add(Object o) { if (nest!=null) nest.add(o); else { if (o!=null) { if (o instanceof Element) { if(o instanceof Page) throw new IllegalArgumentException("Can't inse...
[ "public", "Composite", "add", "(", "Object", "o", ")", "{", "if", "(", "nest", "!=", "null", ")", "nest", ".", "add", "(", "o", ")", ";", "else", "{", "if", "(", "o", "!=", "null", ")", "{", "if", "(", "o", "instanceof", "Element", ")", "{", ...
Add an Object to the Composite by converting it to a Element or. String @param o The Object to add. If it is a String or Element, it is added directly, otherwise toString() is called. @return This Composite (for chained commands)
[ "Add", "an", "Object", "to", "the", "Composite", "by", "converting", "it", "to", "a", "Element", "or", ".", "String" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L71-L92
100,754
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.nest
public Composite nest(Composite c) { if (nest!=null) return nest.nest(c); else { add(c); nest=c; } return this; }
java
public Composite nest(Composite c) { if (nest!=null) return nest.nest(c); else { add(c); nest=c; } return this; }
[ "public", "Composite", "nest", "(", "Composite", "c", ")", "{", "if", "(", "nest", "!=", "null", ")", "return", "nest", ".", "nest", "(", "c", ")", ";", "else", "{", "add", "(", "c", ")", ";", "nest", "=", "c", ";", "}", "return", "this", ";", ...
Nest a Composite within a Composite. The passed Composite is added to this Composite. Adds to this composite are actually added to the nested Composite. Calls to nest are passed the nested Composite @return The Composite to unest on to return to the original state.
[ "Nest", "a", "Composite", "within", "a", "Composite", ".", "The", "passed", "Composite", "is", "added", "to", "this", "Composite", ".", "Adds", "to", "this", "composite", "are", "actually", "added", "to", "the", "nested", "Composite", ".", "Calls", "to", "...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L102-L112
100,755
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.write
public void write(Writer out) throws IOException { for (int i=0; i <elements.size() ; i++) { Object element = elements.get(i); if (element instanceof Element) ((Element)element).write(out); else if (element==null) ...
java
public void write(Writer out) throws IOException { for (int i=0; i <elements.size() ; i++) { Object element = elements.get(i); if (element instanceof Element) ((Element)element).write(out); else if (element==null) ...
[ "public", "void", "write", "(", "Writer", "out", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "elements", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Object", "element", "=", "elements", ".", "get", "(...
Write the composite. The default implementation writes the elements sequentially. May be overridden for more specialized behaviour. @param out Writer to write the element to.
[ "Write", "the", "composite", ".", "The", "default", "implementation", "writes", "the", "elements", "sequentially", ".", "May", "be", "overridden", "for", "more", "specialized", "behaviour", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L155-L169
100,756
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.contents
public String contents() { StringBuffer buf = new StringBuffer(); synchronized(buf) { for (int i=0; i <elements.size() ; i++) { Object element = elements.get(i); if (element==null) buf.append("null"); ...
java
public String contents() { StringBuffer buf = new StringBuffer(); synchronized(buf) { for (int i=0; i <elements.size() ; i++) { Object element = elements.get(i); if (element==null) buf.append("null"); ...
[ "public", "String", "contents", "(", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "synchronized", "(", "buf", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "elements", ".", "size", "(", ")", ";", "i", "...
Contents of the composite.
[ "Contents", "of", "the", "composite", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L174-L189
100,757
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Composite.java
Composite.replace
public boolean replace(Object oldObj, Object newObj) { if (nest != null) { return nest.replace(oldObj, newObj); } else { int sz = elements.size(); for (int i = 0; i < sz; i++) { if (elements.get(i) == oldObj) ...
java
public boolean replace(Object oldObj, Object newObj) { if (nest != null) { return nest.replace(oldObj, newObj); } else { int sz = elements.size(); for (int i = 0; i < sz; i++) { if (elements.get(i) == oldObj) ...
[ "public", "boolean", "replace", "(", "Object", "oldObj", ",", "Object", "newObj", ")", "{", "if", "(", "nest", "!=", "null", ")", "{", "return", "nest", ".", "replace", "(", "oldObj", ",", "newObj", ")", ";", "}", "else", "{", "int", "sz", "=", "el...
Replace an object within the composite.
[ "Replace", "an", "object", "within", "the", "composite", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Composite.java#L239-L259
100,758
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java
OutputStreamLogSink.log
public synchronized void log(String formattedLog) { if (_reopen || _out==null) { stop(); start(); } try { _buffer.write(formattedLog); _buffer.write(StringUtil.__LINE_SEPARATOR); if (_flushOn || _buffer.size()>_buffe...
java
public synchronized void log(String formattedLog) { if (_reopen || _out==null) { stop(); start(); } try { _buffer.write(formattedLog); _buffer.write(StringUtil.__LINE_SEPARATOR); if (_flushOn || _buffer.size()>_buffe...
[ "public", "synchronized", "void", "log", "(", "String", "formattedLog", ")", "{", "if", "(", "_reopen", "||", "_out", "==", "null", ")", "{", "stop", "(", ")", ";", "start", "(", ")", ";", "}", "try", "{", "_buffer", ".", "write", "(", "formattedLog"...
Log a message. The formatted log string is written to the log sink. The default implementation writes the message to an outputstream. @param formattedLog
[ "Log", "a", "message", ".", "The", "formatted", "log", "string", "is", "written", "to", "the", "log", "sink", ".", "The", "default", "implementation", "writes", "the", "message", "to", "an", "outputstream", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L395-L414
100,759
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java
OutputStreamLogSink.start
public synchronized void start() { _buffer=new ByteArrayISO8859Writer(_bufferSize); _reopen=false; if (_started) return; if (_out==null && _filename!=null) { try { RolloverFileOutputStream rfos= ...
java
public synchronized void start() { _buffer=new ByteArrayISO8859Writer(_bufferSize); _reopen=false; if (_started) return; if (_out==null && _filename!=null) { try { RolloverFileOutputStream rfos= ...
[ "public", "synchronized", "void", "start", "(", ")", "{", "_buffer", "=", "new", "ByteArrayISO8859Writer", "(", "_bufferSize", ")", ";", "_reopen", "=", "false", ";", "if", "(", "_started", ")", "return", ";", "if", "(", "_out", "==", "null", "&&", "_fil...
Start a log sink. The default implementation does nothing
[ "Start", "a", "log", "sink", ".", "The", "default", "implementation", "does", "nothing" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L421-L443
100,760
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java
OutputStreamLogSink.stop
public synchronized void stop() { _started=false; if (_out!=null) { try { if (_buffer.size()>0) { _buffer.writeTo(_out); } _out.flush(); _buffer=null; } ...
java
public synchronized void stop() { _started=false; if (_out!=null) { try { if (_buffer.size()>0) { _buffer.writeTo(_out); } _out.flush(); _buffer=null; } ...
[ "public", "synchronized", "void", "stop", "(", ")", "{", "_started", "=", "false", ";", "if", "(", "_out", "!=", "null", ")", "{", "try", "{", "if", "(", "_buffer", ".", "size", "(", ")", ">", "0", ")", "{", "_buffer", ".", "writeTo", "(", "_out"...
Stop a log sink. An opportunity for subclasses to clean up. The default implementation does nothing
[ "Stop", "a", "log", "sink", ".", "An", "opportunity", "for", "subclasses", "to", "clean", "up", ".", "The", "default", "implementation", "does", "nothing" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/log/OutputStreamLogSink.java#L451-L478
100,761
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.getPartNames
public String[] getPartNames() { Set s = _partMap.keySet(); return (String[]) s.toArray(new String[s.size()]); }
java
public String[] getPartNames() { Set s = _partMap.keySet(); return (String[]) s.toArray(new String[s.size()]); }
[ "public", "String", "[", "]", "getPartNames", "(", ")", "{", "Set", "s", "=", "_partMap", ".", "keySet", "(", ")", ";", "return", "(", "String", "[", "]", ")", "s", ".", "toArray", "(", "new", "String", "[", "s", ".", "size", "(", ")", "]", ")"...
Get the part names. @return an array of part names
[ "Get", "the", "part", "names", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L99-L103
100,762
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.contains
public boolean contains(String name) { Part part = (Part)_partMap.get(name); return (part!=null); }
java
public boolean contains(String name) { Part part = (Part)_partMap.get(name); return (part!=null); }
[ "public", "boolean", "contains", "(", "String", "name", ")", "{", "Part", "part", "=", "(", "Part", ")", "_partMap", ".", "get", "(", "name", ")", ";", "return", "(", "part", "!=", "null", ")", ";", "}" ]
Check if a named part is present @param name The part @return true if it was included
[ "Check", "if", "a", "named", "part", "is", "present" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L110-L114
100,763
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.getString
public String getString(String name) { List part = _partMap.getValues(name); if (part==null) return null; if (_encoding != null) { try { return new String(((Part)part.get(0))._data, _encoding); } catch (Uns...
java
public String getString(String name) { List part = _partMap.getValues(name); if (part==null) return null; if (_encoding != null) { try { return new String(((Part)part.get(0))._data, _encoding); } catch (Uns...
[ "public", "String", "getString", "(", "String", "name", ")", "{", "List", "part", "=", "_partMap", ".", "getValues", "(", "name", ")", ";", "if", "(", "part", "==", "null", ")", "return", "null", ";", "if", "(", "_encoding", "!=", "null", ")", "{", ...
Get the data of a part as a string. @param name The part name @return The part data
[ "Get", "the", "data", "of", "a", "part", "as", "a", "string", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L121-L140
100,764
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.getInputStream
public InputStream getInputStream(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return new ByteArrayInputStream(((Part)part.get(0))._data); }
java
public InputStream getInputStream(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return new ByteArrayInputStream(((Part)part.get(0))._data); }
[ "public", "InputStream", "getInputStream", "(", "String", "name", ")", "{", "List", "part", "=", "(", "List", ")", "_partMap", ".", "getValues", "(", "name", ")", ";", "if", "(", "part", "==", "null", ")", "return", "null", ";", "return", "new", "ByteA...
Get the data of a part as a stream. @param name The part name @return Stream providing the part data
[ "Get", "the", "data", "of", "a", "part", "as", "a", "stream", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L181-L187
100,765
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.getParams
public Hashtable getParams(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return ((Part)part.get(0))._headers; }
java
public Hashtable getParams(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return ((Part)part.get(0))._headers; }
[ "public", "Hashtable", "getParams", "(", "String", "name", ")", "{", "List", "part", "=", "(", "List", ")", "_partMap", ".", "getValues", "(", "name", ")", ";", "if", "(", "part", "==", "null", ")", "return", "null", ";", "return", "(", "(", "Part", ...
Get the MIME parameters associated with a part. @param name The part name @return Hashtable of parameters
[ "Get", "the", "MIME", "parameters", "associated", "with", "a", "part", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L207-L213
100,766
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java
MultiPartRequest.getFilename
public String getFilename(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return ((Part)part.get(0))._filename; }
java
public String getFilename(String name) { List part = (List)_partMap.getValues(name); if (part==null) return null; return ((Part)part.get(0))._filename; }
[ "public", "String", "getFilename", "(", "String", "name", ")", "{", "List", "part", "=", "(", "List", ")", "_partMap", ".", "getValues", "(", "name", ")", ";", "if", "(", "part", "==", "null", ")", "return", "null", ";", "return", "(", "(", "Part", ...
Get any file name associated with a part. @param name The part name @return The filename
[ "Get", "any", "file", "name", "associated", "with", "a", "part", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/servlet/MultiPartRequest.java#L233-L239
100,767
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.getServletHandler
public synchronized ServletHandler getServletHandler() { if (_webAppHandler == null) { _webAppHandler= (WebApplicationHandler)getHandler(WebApplicationHandler.class); if (_webAppHandler == null) { if (getHandler(ServletHandler.class) != null) ...
java
public synchronized ServletHandler getServletHandler() { if (_webAppHandler == null) { _webAppHandler= (WebApplicationHandler)getHandler(WebApplicationHandler.class); if (_webAppHandler == null) { if (getHandler(ServletHandler.class) != null) ...
[ "public", "synchronized", "ServletHandler", "getServletHandler", "(", ")", "{", "if", "(", "_webAppHandler", "==", "null", ")", "{", "_webAppHandler", "=", "(", "WebApplicationHandler", ")", "getHandler", "(", "WebApplicationHandler", ".", "class", ")", ";", "if",...
Get the context ServletHandler. Conveniance method. If no ServletHandler exists, a new one is added to the context. This derivation of the method creates a WebApplicationHandler extension of ServletHandler. @return WebApplicationHandler
[ "Get", "the", "context", "ServletHandler", ".", "Conveniance", "method", ".", "If", "no", "ServletHandler", "exists", "a", "new", "one", "is", "added", "to", "the", "context", ".", "This", "derivation", "of", "the", "method", "creates", "a", "WebApplicationHan...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L300-L314
100,768
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.doStart
protected void doStart() throws Exception { if (isStarted()) return; // save context classloader Thread thread= Thread.currentThread(); ClassLoader lastContextLoader= thread.getContextClassLoader(); MultiException mex= null; try { // ...
java
protected void doStart() throws Exception { if (isStarted()) return; // save context classloader Thread thread= Thread.currentThread(); ClassLoader lastContextLoader= thread.getContextClassLoader(); MultiException mex= null; try { // ...
[ "protected", "void", "doStart", "(", ")", "throws", "Exception", "{", "if", "(", "isStarted", "(", ")", ")", "return", ";", "// save context classloader", "Thread", "thread", "=", "Thread", ".", "currentThread", "(", ")", ";", "ClassLoader", "lastContextLoader",...
Start the Web Application. @exception IOException
[ "Start", "the", "Web", "Application", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L425-L520
100,769
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.setResourceAlias
public void setResourceAlias(String alias, String uri) { if (_resourceAliases == null) _resourceAliases= new HashMap(5); _resourceAliases.put(alias, uri); }
java
public void setResourceAlias(String alias, String uri) { if (_resourceAliases == null) _resourceAliases= new HashMap(5); _resourceAliases.put(alias, uri); }
[ "public", "void", "setResourceAlias", "(", "String", "alias", ",", "String", "uri", ")", "{", "if", "(", "_resourceAliases", "==", "null", ")", "_resourceAliases", "=", "new", "HashMap", "(", "5", ")", ";", "_resourceAliases", ".", "put", "(", "alias", ","...
Set Resource Alias. Resource aliases map resource uri's within a context. They may optionally be used by a handler when looking for a resource. @param alias @param uri
[ "Set", "Resource", "Alias", ".", "Resource", "aliases", "map", "resource", "uri", "s", "within", "a", "context", ".", "They", "may", "optionally", "be", "used", "by", "a", "handler", "when", "looking", "for", "a", "resource", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L738-L743
100,770
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.setErrorPage
public void setErrorPage(String error, String uriInContext) { if (_errorPages == null) _errorPages= new HashMap(); _errorPages.put(error, uriInContext); }
java
public void setErrorPage(String error, String uriInContext) { if (_errorPages == null) _errorPages= new HashMap(); _errorPages.put(error, uriInContext); }
[ "public", "void", "setErrorPage", "(", "String", "error", ",", "String", "uriInContext", ")", "{", "if", "(", "_errorPages", "==", "null", ")", "_errorPages", "=", "new", "HashMap", "(", ")", ";", "_errorPages", ".", "put", "(", "error", ",", "uriInContext...
set error page URI. @param error A string representing an error code or a exception classname @param uriInContext
[ "set", "error", "page", "URI", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L801-L806
100,771
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java
WebApplicationContext.getErrorPage
public String getErrorPage(String error) { if (_errorPages == null) return null; return (String)_errorPages.get(error); }
java
public String getErrorPage(String error) { if (_errorPages == null) return null; return (String)_errorPages.get(error); }
[ "public", "String", "getErrorPage", "(", "String", "error", ")", "{", "if", "(", "_errorPages", "==", "null", ")", "return", "null", ";", "return", "(", "String", ")", "_errorPages", ".", "get", "(", "error", ")", ";", "}" ]
get error page URI. @param error A string representing an error code or a exception classname @return URI within context
[ "get", "error", "page", "URI", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationContext.java#L814-L819
100,772
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java
ThreadPool.setName
public void setName(String name) { synchronized(Pool.class) { if(isStarted()) { if((name==null&&_pool.getPoolName()!=null)||(name!=null&&!name.equals(_pool.getPoolName()))) throw new IllegalStateException("started"); return;...
java
public void setName(String name) { synchronized(Pool.class) { if(isStarted()) { if((name==null&&_pool.getPoolName()!=null)||(name!=null&&!name.equals(_pool.getPoolName()))) throw new IllegalStateException("started"); return;...
[ "public", "void", "setName", "(", "String", "name", ")", "{", "synchronized", "(", "Pool", ".", "class", ")", "{", "if", "(", "isStarted", "(", ")", ")", "{", "if", "(", "(", "name", "==", "null", "&&", "_pool", ".", "getPoolName", "(", ")", "!=", ...
Set the Pool name. All ThreadPool instances with the same Pool name will share the same Pool instance. Thus they will share the same max, min and available Threads. The field values of the first ThreadPool to call setPoolName with a specific name are used for the named Pool. Subsequent ThreadPools that join the name po...
[ "Set", "the", "Pool", "name", ".", "All", "ThreadPool", "instances", "with", "the", "same", "Pool", "name", "will", "share", "the", "same", "Pool", "instance", ".", "Thus", "they", "will", "share", "the", "same", "max", "min", "and", "available", "Threads"...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java#L89-L117
100,773
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java
ThreadPool.getThreadsPriority
public int getThreadsPriority() { int priority=Thread.NORM_PRIORITY; Object o=_pool.getAttribute(__PRIORITY); if(o!=null) { priority=((Integer)o).intValue(); } return priority; }
java
public int getThreadsPriority() { int priority=Thread.NORM_PRIORITY; Object o=_pool.getAttribute(__PRIORITY); if(o!=null) { priority=((Integer)o).intValue(); } return priority; }
[ "public", "int", "getThreadsPriority", "(", ")", "{", "int", "priority", "=", "Thread", ".", "NORM_PRIORITY", ";", "Object", "o", "=", "_pool", ".", "getAttribute", "(", "__PRIORITY", ")", ";", "if", "(", "o", "!=", "null", ")", "{", "priority", "=", "...
Get the priority of the pool threads. @return the priority of the pool threads.
[ "Get", "the", "priority", "of", "the", "pool", "threads", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java#L269-L278
100,774
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java
ThreadPool.run
public void run(Object job) throws InterruptedException { if(job==null) return; try { PoolThread thread=(PoolThread)_pool.get(getMaxIdleTimeMs()); if(thread!=null) thread.run(this,job); else { log.war...
java
public void run(Object job) throws InterruptedException { if(job==null) return; try { PoolThread thread=(PoolThread)_pool.get(getMaxIdleTimeMs()); if(thread!=null) thread.run(this,job); else { log.war...
[ "public", "void", "run", "(", "Object", "job", ")", "throws", "InterruptedException", "{", "if", "(", "job", "==", "null", ")", "return", ";", "try", "{", "PoolThread", "thread", "=", "(", "PoolThread", ")", "_pool", ".", "get", "(", "getMaxIdleTimeMs", ...
Run job. Give a job to the pool. @param job If the job is derived from Runnable, the run method is called, otherwise it is passed as the argument to the handle method.
[ "Run", "job", ".", "Give", "a", "job", "to", "the", "pool", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java#L362-L385
100,775
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java
ThreadPool.handle
protected void handle(Object job) throws InterruptedException { if(job!=null&&job instanceof Runnable) ((Runnable)job).run(); else log.warn("Invalid job: "+job); }
java
protected void handle(Object job) throws InterruptedException { if(job!=null&&job instanceof Runnable) ((Runnable)job).run(); else log.warn("Invalid job: "+job); }
[ "protected", "void", "handle", "(", "Object", "job", ")", "throws", "InterruptedException", "{", "if", "(", "job", "!=", "null", "&&", "job", "instanceof", "Runnable", ")", "(", "(", "Runnable", ")", "job", ")", ".", "run", "(", ")", ";", "else", "log"...
Handle a job. Called by the allocated thread to handle a job. If the job is a Runnable, it's run method is called. Otherwise this method needs to be specialized by a derived class to provide specific handling. @param job The job to execute. @exception InterruptedException
[ "Handle", "a", "job", ".", "Called", "by", "the", "allocated", "thread", "to", "handle", "a", "job", ".", "If", "the", "job", "is", "a", "Runnable", "it", "s", "run", "method", "is", "called", ".", "Otherwise", "this", "method", "needs", "to", "be", ...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadPool.java#L396-L402
100,776
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/KEYConverter.java
KEYConverter.parseRecord
public static PublicKey parseRecord(DNSKEYRecord r) { int alg = r.getAlgorithm(); byte [] data = r.getKey(); return parseRecord(alg, data); }
java
public static PublicKey parseRecord(DNSKEYRecord r) { int alg = r.getAlgorithm(); byte [] data = r.getKey(); return parseRecord(alg, data); }
[ "public", "static", "PublicKey", "parseRecord", "(", "DNSKEYRecord", "r", ")", "{", "int", "alg", "=", "r", ".", "getAlgorithm", "(", ")", ";", "byte", "[", "]", "data", "=", "r", ".", "getKey", "(", ")", ";", "return", "parseRecord", "(", "alg", ","...
Converts a DNSKEY record into a PublicKey
[ "Converts", "a", "DNSKEY", "record", "into", "a", "PublicKey" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/KEYConverter.java#L153-L158
100,777
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/KEYConverter.java
KEYConverter.parseRecord
public static PublicKey parseRecord(KEYRecord r) { int alg = r.getAlgorithm(); byte [] data = r.getKey(); return parseRecord(alg, data); }
java
public static PublicKey parseRecord(KEYRecord r) { int alg = r.getAlgorithm(); byte [] data = r.getKey(); return parseRecord(alg, data); }
[ "public", "static", "PublicKey", "parseRecord", "(", "KEYRecord", "r", ")", "{", "int", "alg", "=", "r", ".", "getAlgorithm", "(", ")", ";", "byte", "[", "]", "data", "=", "r", ".", "getKey", "(", ")", ";", "return", "parseRecord", "(", "alg", ",", ...
Converts a KEY record into a PublicKey
[ "Converts", "a", "KEY", "record", "into", "a", "PublicKey" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/KEYConverter.java#L161-L166
100,778
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/KEYConverter.java
KEYConverter.buildRecord
public static KEYRecord buildRecord(Name name, int dclass, long ttl, int flags, int proto, PublicKey key) { byte alg; if (key instanceof RSAPublicKey) { alg = DNSSEC.RSAMD5; } else if (key instanceof DHPublicKey) { alg = DNSSEC.DH; } else if (key instanceof DSAPublicKey) { alg = DNSSEC.DSA; } else ...
java
public static KEYRecord buildRecord(Name name, int dclass, long ttl, int flags, int proto, PublicKey key) { byte alg; if (key instanceof RSAPublicKey) { alg = DNSSEC.RSAMD5; } else if (key instanceof DHPublicKey) { alg = DNSSEC.DH; } else if (key instanceof DSAPublicKey) { alg = DNSSEC.DSA; } else ...
[ "public", "static", "KEYRecord", "buildRecord", "(", "Name", "name", ",", "int", "dclass", ",", "long", "ttl", ",", "int", "flags", ",", "int", "proto", ",", "PublicKey", "key", ")", "{", "byte", "alg", ";", "if", "(", "key", "instanceof", "RSAPublicKey"...
Builds a KEY record from a PublicKey
[ "Builds", "a", "KEY", "record", "from", "a", "PublicKey" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/KEYConverter.java#L242-L262
100,779
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/KEYConverter.java
KEYConverter.buildRecord
public static Record buildRecord(Name name, int type, int dclass, long ttl, int flags, int proto, int alg, PublicKey key) { byte [] data; if (type != Type.KEY && type != Type.DNSKEY) throw new IllegalArgumentException("type must be KEY " + "or DNSKEY"); if (key instanceof RSAPublicKey) { data = b...
java
public static Record buildRecord(Name name, int type, int dclass, long ttl, int flags, int proto, int alg, PublicKey key) { byte [] data; if (type != Type.KEY && type != Type.DNSKEY) throw new IllegalArgumentException("type must be KEY " + "or DNSKEY"); if (key instanceof RSAPublicKey) { data = b...
[ "public", "static", "Record", "buildRecord", "(", "Name", "name", ",", "int", "type", ",", "int", "dclass", ",", "long", "ttl", ",", "int", "flags", ",", "int", "proto", ",", "int", "alg", ",", "PublicKey", "key", ")", "{", "byte", "[", "]", "data", ...
Builds a DNSKEY or KEY record from a PublicKey
[ "Builds", "a", "DNSKEY", "or", "KEY", "record", "from", "a", "PublicKey" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/KEYConverter.java#L265-L296
100,780
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LineInput.java
LineInput.setByteLimit
public void setByteLimit(int bytes) { _byteLimit=bytes; if (bytes>=0) { _newByteLimit=true; _byteLimit-=_contents-_pos; if (_byteLimit<0) { _avail+=_byteLimit; _byteLimit=0; } } ...
java
public void setByteLimit(int bytes) { _byteLimit=bytes; if (bytes>=0) { _newByteLimit=true; _byteLimit-=_contents-_pos; if (_byteLimit<0) { _avail+=_byteLimit; _byteLimit=0; } } ...
[ "public", "void", "setByteLimit", "(", "int", "bytes", ")", "{", "_byteLimit", "=", "bytes", ";", "if", "(", "bytes", ">=", "0", ")", "{", "_newByteLimit", "=", "true", ";", "_byteLimit", "-=", "_contents", "-", "_pos", ";", "if", "(", "_byteLimit", "<...
Set the byte limit. If set, only this number of bytes are read before EOF. @param bytes Limit number of bytes, or -1 for no limit.
[ "Set", "the", "byte", "limit", ".", "If", "set", "only", "this", "number", "of", "bytes", "are", "read", "before", "EOF", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LineInput.java#L138-L158
100,781
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LineInput.java
LineInput.readLine
public int readLine(byte[] b,int off,int len) throws IOException { len=fillLine(len); if (len<0) return -1; if (len==0) return 0; System.arraycopy(_buf,_mark, b, off, len); _mark=-1; return len; }
java
public int readLine(byte[] b,int off,int len) throws IOException { len=fillLine(len); if (len<0) return -1; if (len==0) return 0; System.arraycopy(_buf,_mark, b, off, len); _mark=-1; return len; }
[ "public", "int", "readLine", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "len", "=", "fillLine", "(", "len", ")", ";", "if", "(", "len", "<", "0", ")", "return", "-", "1", ";", "if", "(",...
Read a line ended by CR, LF or CRLF. @param b Byte array to place the line into. @param off Offset into the buffer. @param len Maximum length of line. @return The length of the line or -1 for EOF. @exception IOException
[ "Read", "a", "line", "ended", "by", "CR", "LF", "or", "CRLF", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LineInput.java#L251-L265
100,782
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LineInput.java
LineInput.readLineBuffer
public LineBuffer readLineBuffer(int len) throws IOException { len=fillLine(len>0?len:_buf.length); if (len<0) return null; if (len==0) { _lineBuffer.size=0; return _lineBuffer; } _byteBuffer.setStream(_mark,len);...
java
public LineBuffer readLineBuffer(int len) throws IOException { len=fillLine(len>0?len:_buf.length); if (len<0) return null; if (len==0) { _lineBuffer.size=0; return _lineBuffer; } _byteBuffer.setStream(_mark,len);...
[ "public", "LineBuffer", "readLineBuffer", "(", "int", "len", ")", "throws", "IOException", "{", "len", "=", "fillLine", "(", "len", ">", "0", "?", "len", ":", "_buf", ".", "length", ")", ";", "if", "(", "len", "<", "0", ")", "return", "null", ";", ...
Read a Line ended by CR, LF or CRLF. Read a line into a shared LineBuffer instance. The LineBuffer is resused between calls and should not be held by the caller. The default or supplied encoding is used to convert bytes to characters. @param len Maximum length of a line, or 0 for default @return LineBuffer instance or...
[ "Read", "a", "Line", "ended", "by", "CR", "LF", "or", "CRLF", ".", "Read", "a", "line", "into", "a", "shared", "LineBuffer", "instance", ".", "The", "LineBuffer", "is", "resused", "between", "calls", "and", "should", "not", "be", "held", "by", "the", "...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LineInput.java#L293-L324
100,783
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/utils/hexdump.java
hexdump.dump
public static String dump(String description, byte [] b, int offset, int length) { StringBuffer sb = new StringBuffer(); sb.append(length + "b"); if (description != null) sb.append(" (" + description + ")"); sb.append(':'); int prefixlen = sb.toString().length(); prefixlen = (prefixlen + 8) & ~ 7; sb.append(...
java
public static String dump(String description, byte [] b, int offset, int length) { StringBuffer sb = new StringBuffer(); sb.append(length + "b"); if (description != null) sb.append(" (" + description + ")"); sb.append(':'); int prefixlen = sb.toString().length(); prefixlen = (prefixlen + 8) & ~ 7; sb.append(...
[ "public", "static", "String", "dump", "(", "String", "description", ",", "byte", "[", "]", "b", ",", "int", "offset", ",", "int", "length", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "sb", ".", "append", "(", "length", ...
Dumps a byte array into hex format. @param description If not null, a description of the data. @param b The data to be printed. @param offset The start of the data in the array. @param length The length of the data in the array.
[ "Dumps", "a", "byte", "array", "into", "hex", "format", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/utils/hexdump.java#L22-L49
100,784
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Resource.java
Resource.newResource
public static Resource newResource(URL url) throws IOException { if (url==null) return null; String urls=url.toExternalForm(); if( urls.startsWith( "file:")) { try { FileResource fileResource= new FileResource(url); ...
java
public static Resource newResource(URL url) throws IOException { if (url==null) return null; String urls=url.toExternalForm(); if( urls.startsWith( "file:")) { try { FileResource fileResource= new FileResource(url); ...
[ "public", "static", "Resource", "newResource", "(", "URL", "url", ")", "throws", "IOException", "{", "if", "(", "url", "==", "null", ")", "return", "null", ";", "String", "urls", "=", "url", ".", "toExternalForm", "(", ")", ";", "if", "(", "urls", ".",...
Construct a resource from a url. @param url A URL. @return A Resource object.
[ "Construct", "a", "resource", "from", "a", "url", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Resource.java#L47-L77
100,785
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Resource.java
Resource.newResource
public static Resource newResource(String resource) throws MalformedURLException, IOException { URL url=null; try { // Try to format as a URL? url = new URL(resource); } catch(MalformedURLException e) { if(!resource.startsWi...
java
public static Resource newResource(String resource) throws MalformedURLException, IOException { URL url=null; try { // Try to format as a URL? url = new URL(resource); } catch(MalformedURLException e) { if(!resource.startsWi...
[ "public", "static", "Resource", "newResource", "(", "String", "resource", ")", "throws", "MalformedURLException", ",", "IOException", "{", "URL", "url", "=", "null", ";", "try", "{", "// Try to format as a URL?", "url", "=", "new", "URL", "(", "resource", ")", ...
Construct a resource from a string. @param resource A URL or filename. @return A Resource object.
[ "Construct", "a", "resource", "from", "a", "string", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Resource.java#L84-L141
100,786
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Resource.java
Resource.newSystemResource
public static Resource newSystemResource(String resource) throws IOException { URL url=null; // Try to format as a URL? ClassLoader loader=Thread.currentThread().getContextClassLoader(); if (loader!=null) { url=loader.getResource(resource); ...
java
public static Resource newSystemResource(String resource) throws IOException { URL url=null; // Try to format as a URL? ClassLoader loader=Thread.currentThread().getContextClassLoader(); if (loader!=null) { url=loader.getResource(resource); ...
[ "public", "static", "Resource", "newSystemResource", "(", "String", "resource", ")", "throws", "IOException", "{", "URL", "url", "=", "null", ";", "// Try to format as a URL?", "ClassLoader", "loader", "=", "Thread", ".", "currentThread", "(", ")", ".", "getContex...
Construct a system resource from a string. The resource is tried as classloader resource before being treated as a normal resource.
[ "Construct", "a", "system", "resource", "from", "a", "string", ".", "The", "resource", "is", "tried", "as", "classloader", "resource", "before", "being", "treated", "as", "a", "normal", "resource", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Resource.java#L148-L183
100,787
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/Resource.java
Resource.getListHTML
public String getListHTML(String base, boolean parent) throws IOException { if (!isDirectory()) return null; String[] ls = list(); if (ls==null) return null; Arrays.sort(ls); String title =...
java
public String getListHTML(String base, boolean parent) throws IOException { if (!isDirectory()) return null; String[] ls = list(); if (ls==null) return null; Arrays.sort(ls); String title =...
[ "public", "String", "getListHTML", "(", "String", "base", ",", "boolean", "parent", ")", "throws", "IOException", "{", "if", "(", "!", "isDirectory", "(", ")", ")", "return", "null", ";", "String", "[", "]", "ls", "=", "list", "(", ")", ";", "if", "(...
Get the resource list as a HTML directory listing. @param base The base URL @param parent True if the parent directory should be included @return String of HTML
[ "Get", "the", "resource", "list", "as", "a", "HTML", "directory", "listing", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/Resource.java#L342-L398
100,788
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/AbstractSessionManager.java
AbstractSessionManager.scavenge
private void scavenge() { Thread thread = Thread.currentThread(); ClassLoader old_loader = thread.getContextClassLoader(); try { if (_handler==null) return; ClassLoader loader = _handler.getClassLoader(); if (loader!=nu...
java
private void scavenge() { Thread thread = Thread.currentThread(); ClassLoader old_loader = thread.getContextClassLoader(); try { if (_handler==null) return; ClassLoader loader = _handler.getClassLoader(); if (loader!=nu...
[ "private", "void", "scavenge", "(", ")", "{", "Thread", "thread", "=", "Thread", ".", "currentThread", "(", ")", ";", "ClassLoader", "old_loader", "=", "thread", ".", "getContextClassLoader", "(", ")", ";", "try", "{", "if", "(", "_handler", "==", "null", ...
Find sessions that have timed out and invalidate them. This runs in the SessionScavenger thread.
[ "Find", "sessions", "that", "have", "timed", "out", "and", "invalidate", "them", ".", "This", "runs", "in", "the", "SessionScavenger", "thread", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/AbstractSessionManager.java#L513-L566
100,789
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/JDBCUserRealm.java
JDBCUserRealm.loadConfig
public void loadConfig(String config) throws IOException { Properties properties = new Properties(); Resource resource=Resource.newResource(config); properties.load(resource.getInputStream()); _jdbcDriver = properties.getProperty("jdbcdriver"); _url = propert...
java
public void loadConfig(String config) throws IOException { Properties properties = new Properties(); Resource resource=Resource.newResource(config); properties.load(resource.getInputStream()); _jdbcDriver = properties.getProperty("jdbcdriver"); _url = propert...
[ "public", "void", "loadConfig", "(", "String", "config", ")", "throws", "IOException", "{", "Properties", "properties", "=", "new", "Properties", "(", ")", ";", "Resource", "resource", "=", "Resource", ".", "newResource", "(", "config", ")", ";", "properties",...
Load JDBC connection configuration from properties file. @param config Filename or url of user properties file. @exception IOException
[ "Load", "JDBC", "connection", "configuration", "from", "properties", "file", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/JDBCUserRealm.java#L111-L155
100,790
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/XMLConfiguration.java
XMLConfiguration.initWebXmlElement
protected void initWebXmlElement(String element,XmlParser.Node node) throws Exception { if("display-name".equals(element)) initDisplayName(node); else if("description".equals(element)) {} else if("context-param".equals(element)) initContextParam(node); ...
java
protected void initWebXmlElement(String element,XmlParser.Node node) throws Exception { if("display-name".equals(element)) initDisplayName(node); else if("description".equals(element)) {} else if("context-param".equals(element)) initContextParam(node); ...
[ "protected", "void", "initWebXmlElement", "(", "String", "element", ",", "XmlParser", ".", "Node", "node", ")", "throws", "Exception", "{", "if", "(", "\"display-name\"", ".", "equals", "(", "element", ")", ")", "initDisplayName", "(", "node", ")", ";", "els...
Handle web.xml element. This method is called for each top level element within the web.xml file. It may be specialized by derived WebApplicationContexts to provide additional configuration and handling. @param element The element name @param node The node containing the element.
[ "Handle", "web", ".", "xml", "element", ".", "This", "method", "is", "called", "for", "each", "top", "level", "element", "within", "the", "web", ".", "xml", "file", ".", "It", "may", "be", "specialized", "by", "derived", "WebApplicationContexts", "to", "pr...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/XMLConfiguration.java#L233-L286
100,791
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.addListener
public HttpListener addListener(InetAddrPort address) throws IOException { HttpListener listener = new SocketListener(address); listener.setHttpServer(this); _listeners.add(listener); addComponent(listener); return listener; }
java
public HttpListener addListener(InetAddrPort address) throws IOException { HttpListener listener = new SocketListener(address); listener.setHttpServer(this); _listeners.add(listener); addComponent(listener); return listener; }
[ "public", "HttpListener", "addListener", "(", "InetAddrPort", "address", ")", "throws", "IOException", "{", "HttpListener", "listener", "=", "new", "SocketListener", "(", "address", ")", ";", "listener", ".", "setHttpServer", "(", "this", ")", ";", "_listeners", ...
Create and add a SocketListener. Conveniance method. @param address @return the HttpListener. @exception IOException
[ "Create", "and", "add", "a", "SocketListener", ".", "Conveniance", "method", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L222-L230
100,792
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.addListener
public HttpListener addListener(HttpListener listener) throws IllegalArgumentException { listener.setHttpServer(this); _listeners.add(listener); addComponent(listener); return listener; }
java
public HttpListener addListener(HttpListener listener) throws IllegalArgumentException { listener.setHttpServer(this); _listeners.add(listener); addComponent(listener); return listener; }
[ "public", "HttpListener", "addListener", "(", "HttpListener", "listener", ")", "throws", "IllegalArgumentException", "{", "listener", ".", "setHttpServer", "(", "this", ")", ";", "_listeners", ".", "add", "(", "listener", ")", ";", "addComponent", "(", "listener",...
Add a HTTP Listener to the server. @param listener The Listener. @exception IllegalArgumentException If the listener is not for this server.
[ "Add", "a", "HTTP", "Listener", "to", "the", "server", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L238-L245
100,793
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.removeListener
public void removeListener(HttpListener listener) { if (listener==null) return; for (int l=0;l<_listeners.size();l++) { if (listener.equals(_listeners.get(l))) { _listeners.remove(l); removeComponent(listener); ...
java
public void removeListener(HttpListener listener) { if (listener==null) return; for (int l=0;l<_listeners.size();l++) { if (listener.equals(_listeners.get(l))) { _listeners.remove(l); removeComponent(listener); ...
[ "public", "void", "removeListener", "(", "HttpListener", "listener", ")", "{", "if", "(", "listener", "==", "null", ")", "return", ";", "for", "(", "int", "l", "=", "0", ";", "l", "<", "_listeners", ".", "size", "(", ")", ";", "l", "++", ")", "{", ...
Remove a HTTP Listener. @param listener
[ "Remove", "a", "HTTP", "Listener", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L251-L267
100,794
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.doStart
protected synchronized void doStart() throws Exception { log.info("Version "+Version.getImplVersion()); MultiException mex = new MultiException(); statsReset(); if (log.isDebugEnabled()) { log.debug("LISTENERS: "+_listeners); ...
java
protected synchronized void doStart() throws Exception { log.info("Version "+Version.getImplVersion()); MultiException mex = new MultiException(); statsReset(); if (log.isDebugEnabled()) { log.debug("LISTENERS: "+_listeners); ...
[ "protected", "synchronized", "void", "doStart", "(", ")", "throws", "Exception", "{", "log", ".", "info", "(", "\"Version \"", "+", "Version", ".", "getImplVersion", "(", ")", ")", ";", "MultiException", "mex", "=", "new", "MultiException", "(", ")", ";", ...
Start all handlers then listeners. If a subcomponent fails to start, it's exception is added to a org.mortbay.util.MultiException and the start method continues. @exception MultiException A collection of exceptions thrown by start() method of subcomponents of the HttpServer.
[ "Start", "all", "handlers", "then", "listeners", ".", "If", "a", "subcomponent", "fails", "to", "start", "it", "s", "exception", "is", "added", "to", "a", "org", ".", "mortbay", ".", "util", ".", "MultiException", "and", "the", "start", "method", "continue...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L664-L703
100,795
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.stop
public synchronized void stop(boolean graceful) throws InterruptedException { boolean ov=_gracefulStop; try { _gracefulStop=graceful; stop(); } finally { _gracefulStop=ov; } }
java
public synchronized void stop(boolean graceful) throws InterruptedException { boolean ov=_gracefulStop; try { _gracefulStop=graceful; stop(); } finally { _gracefulStop=ov; } }
[ "public", "synchronized", "void", "stop", "(", "boolean", "graceful", ")", "throws", "InterruptedException", "{", "boolean", "ov", "=", "_gracefulStop", ";", "try", "{", "_gracefulStop", "=", "graceful", ";", "stop", "(", ")", ";", "}", "finally", "{", "_gra...
Stop all listeners then all contexts. @param graceful If true and statistics are on for a context, then this method will wait for requestsActive to go to zero before stopping that context.
[ "Stop", "all", "listeners", "then", "all", "contexts", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L754-L767
100,796
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.join
public void join() throws InterruptedException { for (int l=0;l<_listeners.size();l++) { HttpListener listener =(HttpListener)_listeners.get(l); if (listener.isStarted() && listener instanceof ThreadPool) { ((ThreadPool)listener).join(); ...
java
public void join() throws InterruptedException { for (int l=0;l<_listeners.size();l++) { HttpListener listener =(HttpListener)_listeners.get(l); if (listener.isStarted() && listener instanceof ThreadPool) { ((ThreadPool)listener).join(); ...
[ "public", "void", "join", "(", ")", "throws", "InterruptedException", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "_listeners", ".", "size", "(", ")", ";", "l", "++", ")", "{", "HttpListener", "listener", "=", "(", "HttpListener", ")", "_li...
Join the listeners. Join all listeners that are instances of ThreadPool. @exception InterruptedException
[ "Join", "the", "listeners", ".", "Join", "all", "listeners", "that", "are", "instances", "of", "ThreadPool", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L774-L785
100,797
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.addHostAlias
public void addHostAlias(String virtualHost, String alias) { log.warn("addHostAlias is deprecated. Use HttpContext.addVirtualHost"); Object contextMap=_virtualHostMap.get(virtualHost); if (contextMap==null) throw new IllegalArgumentException("No Such Host: "+virtualHost); ...
java
public void addHostAlias(String virtualHost, String alias) { log.warn("addHostAlias is deprecated. Use HttpContext.addVirtualHost"); Object contextMap=_virtualHostMap.get(virtualHost); if (contextMap==null) throw new IllegalArgumentException("No Such Host: "+virtualHost); ...
[ "public", "void", "addHostAlias", "(", "String", "virtualHost", ",", "String", "alias", ")", "{", "log", ".", "warn", "(", "\"addHostAlias is deprecated. Use HttpContext.addVirtualHost\"", ")", ";", "Object", "contextMap", "=", "_virtualHostMap", ".", "get", "(", "v...
Define a virtual host alias. All requests to the alias are handled the same as request for the virtualHost. @deprecated Use HttpContext.addVirtualHost @param virtualHost Host name or IP @param alias Alias hostname or IP
[ "Define", "a", "virtual", "host", "alias", ".", "All", "requests", "to", "the", "alias", "are", "handled", "the", "same", "as", "request", "for", "the", "virtualHost", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L795-L802
100,798
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.setRequestLog
public synchronized void setRequestLog(RequestLog log) { if (_requestLog!=null) removeComponent(_requestLog); _requestLog=log; if (_requestLog!=null) addComponent(_requestLog); }
java
public synchronized void setRequestLog(RequestLog log) { if (_requestLog!=null) removeComponent(_requestLog); _requestLog=log; if (_requestLog!=null) addComponent(_requestLog); }
[ "public", "synchronized", "void", "setRequestLog", "(", "RequestLog", "log", ")", "{", "if", "(", "_requestLog", "!=", "null", ")", "removeComponent", "(", "_requestLog", ")", ";", "_requestLog", "=", "log", ";", "if", "(", "_requestLog", "!=", "null", ")", ...
Set the request log. @param log RequestLog to use.
[ "Set", "the", "request", "log", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L808-L815
100,799
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.log
void log(HttpRequest request, HttpResponse response, int length) { if (_requestLog!=null && request!=null && response!=null) _requestLog.log(request,response,length); }
java
void log(HttpRequest request, HttpResponse response, int length) { if (_requestLog!=null && request!=null && response!=null) _requestLog.log(request,response,length); }
[ "void", "log", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ",", "int", "length", ")", "{", "if", "(", "_requestLog", "!=", "null", "&&", "request", "!=", "null", "&&", "response", "!=", "null", ")", "_requestLog", ".", "log", "(", "re...
Log a request to the request log @param request The request. @param response The response generated. @param length The length of the body.
[ "Log", "a", "request", "to", "the", "request", "log" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L831-L839