repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.service
public HttpContext service(HttpRequest request,HttpResponse response) throws IOException, HttpException { String host=request.getHost(); if (_requestsPerGC>0 && _gcRequests++>_requestsPerGC) { _gcRequests=0; System.gc(); } while (true...
java
public HttpContext service(HttpRequest request,HttpResponse response) throws IOException, HttpException { String host=request.getHost(); if (_requestsPerGC>0 && _gcRequests++>_requestsPerGC) { _gcRequests=0; System.gc(); } while (true...
[ "public", "HttpContext", "service", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "IOException", ",", "HttpException", "{", "String", "host", "=", "request", ".", "getHost", "(", ")", ";", "if", "(", "_requestsPerGC", ">", "0",...
Service a request. Handle the request by passing it to the HttpHandler contained in the mapped HttpContexts. The requests host and path are used to select a list of HttpContexts. Each HttpHandler in these context is offered the request in turn, until the request is handled. If no handler handles the request, 404 Not F...
[ "Service", "a", "request", ".", "Handle", "the", "request", "by", "passing", "it", "to", "the", "HttpHandler", "contained", "in", "the", "mapped", "HttpContexts", ".", "The", "requests", "host", "and", "path", "are", "used", "to", "select", "a", "list", "o...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L857-L934
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.findHandler
public HttpHandler findHandler(Class handlerClass, String uri, String[] vhosts) { uri = URI.stripPath(uri); if (vhosts==null || vhosts.length==0) vhosts=__noVirtualHost; for (int h=0; h<vhosts.length ...
java
public HttpHandler findHandler(Class handlerClass, String uri, String[] vhosts) { uri = URI.stripPath(uri); if (vhosts==null || vhosts.length==0) vhosts=__noVirtualHost; for (int h=0; h<vhosts.length ...
[ "public", "HttpHandler", "findHandler", "(", "Class", "handlerClass", ",", "String", "uri", ",", "String", "[", "]", "vhosts", ")", "{", "uri", "=", "URI", ".", "stripPath", "(", "uri", ")", ";", "if", "(", "vhosts", "==", "null", "||", "vhosts", ".", ...
Find handler. Find a handler for a URI. This method is provided for the servlet context getContext method to search for another context by URI. A list of hosts may be passed to qualify the search. @param uri URI that must be satisfied by the servlet handler @param vhosts null or a list of virtual hosts names to searc...
[ "Find", "handler", ".", "Find", "a", "handler", "for", "a", "URI", ".", "This", "method", "is", "provided", "for", "the", "servlet", "context", "getContext", "method", "to", "search", "for", "another", "context", "by", "URI", ".", "A", "list", "of", "hos...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L946-L989
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.getRealm
public UserRealm getRealm(String realmName) { if (realmName==null) { if (_realmMap.size()==1) return (UserRealm)_realmMap.values().iterator().next(); log.warn("Null realmName with multiple known realms"); } return (UserRealm)_realmMap.get(realm...
java
public UserRealm getRealm(String realmName) { if (realmName==null) { if (_realmMap.size()==1) return (UserRealm)_realmMap.values().iterator().next(); log.warn("Null realmName with multiple known realms"); } return (UserRealm)_realmMap.get(realm...
[ "public", "UserRealm", "getRealm", "(", "String", "realmName", ")", "{", "if", "(", "realmName", "==", "null", ")", "{", "if", "(", "_realmMap", ".", "size", "(", ")", "==", "1", ")", "return", "(", "UserRealm", ")", "_realmMap", ".", "values", "(", ...
Get a named UserRealm. @param realmName The name of the realm or null. @return The named realm. If the name is null and only a single realm is known, that is returned.
[ "Get", "a", "named", "UserRealm", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L1003-L1012
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.statsReset
public void statsReset() { _statsStartedAt=System.currentTimeMillis(); _connections=0; _connectionsOpenMin=_connectionsOpen; _connectionsOpenMax=_connectionsOpen; _connectionsOpen=0; _connectionsDurationMin=0; _connectionsDurationMax=0; ...
java
public void statsReset() { _statsStartedAt=System.currentTimeMillis(); _connections=0; _connectionsOpenMin=_connectionsOpen; _connectionsOpenMax=_connectionsOpen; _connectionsOpen=0; _connectionsDurationMin=0; _connectionsDurationMax=0; ...
[ "public", "void", "statsReset", "(", ")", "{", "_statsStartedAt", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "_connections", "=", "0", ";", "_connectionsOpenMin", "=", "_connectionsOpen", ";", "_connectionsOpenMax", "=", "_connectionsOpen", ";", "_con...
Reset statistics.
[ "Reset", "statistics", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L1081-L1108
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.save
public void save(String saveat) throws MalformedURLException, IOException { Resource resource = Resource.newResource(saveat); ObjectOutputStream out = new ObjectOutputStream(resource.getOutputStream()); out.writeObject(this); out.flush(); out.close(); ...
java
public void save(String saveat) throws MalformedURLException, IOException { Resource resource = Resource.newResource(saveat); ObjectOutputStream out = new ObjectOutputStream(resource.getOutputStream()); out.writeObject(this); out.flush(); out.close(); ...
[ "public", "void", "save", "(", "String", "saveat", ")", "throws", "MalformedURLException", ",", "IOException", "{", "Resource", "resource", "=", "Resource", ".", "newResource", "(", "saveat", ")", ";", "ObjectOutputStream", "out", "=", "new", "ObjectOutputStream",...
Save the HttpServer The server is saved by serialization to the given filename or URL. @param saveat A file or URL to save the configuration at. @exception MalformedURLException @exception IOException
[ "Save", "the", "HttpServer", "The", "server", "is", "saved", "by", "serialization", "to", "the", "given", "filename", "or", "URL", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L1371-L1381
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java
HttpServer.main
public static void main(String[] args) { if (args.length==0 || args.length>2) { System.err.println ("\nUsage - java org.browsermob.proxy.jetty.http.HttpServer [<addr>:]<port>"); System.err.println ("\nUsage - java org.browsermob.proxy.jetty.htt...
java
public static void main(String[] args) { if (args.length==0 || args.length>2) { System.err.println ("\nUsage - java org.browsermob.proxy.jetty.http.HttpServer [<addr>:]<port>"); System.err.println ("\nUsage - java org.browsermob.proxy.jetty.htt...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "==", "0", "||", "args", ".", "length", ">", "2", ")", "{", "System", ".", "err", ".", "println", "(", "\"\\nUsage - java org.browsermob.pr...
Construct server from command line arguments. @param args
[ "Construct", "server", "from", "command", "line", "arguments", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpServer.java#L1409-L1460
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/CERTConverter.java
CERTConverter.parseRecord
public static Certificate parseRecord(CERTRecord r) { int type = r.getCertType(); byte [] data = r.getCert(); Certificate cert; try { switch (type) { case CERTRecord.PKIX: { CertificateFactory cf; ByteArrayInputStream bs; cf = CertificateFactory.getInstance("X.509"); bs = new ByteArrayInputStr...
java
public static Certificate parseRecord(CERTRecord r) { int type = r.getCertType(); byte [] data = r.getCert(); Certificate cert; try { switch (type) { case CERTRecord.PKIX: { CertificateFactory cf; ByteArrayInputStream bs; cf = CertificateFactory.getInstance("X.509"); bs = new ByteArrayInputStr...
[ "public", "static", "Certificate", "parseRecord", "(", "CERTRecord", "r", ")", "{", "int", "type", "=", "r", ".", "getCertType", "(", ")", ";", "byte", "[", "]", "data", "=", "r", ".", "getCert", "(", ")", ";", "Certificate", "cert", ";", "try", "{",...
Converts a CERT record into a Certificate
[ "Converts", "a", "CERT", "record", "into", "a", "Certificate" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/CERTConverter.java#L27-L53
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/CERTConverter.java
CERTConverter.buildRecord
public static CERTRecord buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag, int alg) { int type; byte [] data; try { if (cert instanceof X509Certificate) { type = CERTRecord.PKIX; data = cert.getEncoded(); } else return null; return new CERTRecord(name, dclass, ttl, type,...
java
public static CERTRecord buildRecord(Name name, int dclass, long ttl, Certificate cert, int tag, int alg) { int type; byte [] data; try { if (cert instanceof X509Certificate) { type = CERTRecord.PKIX; data = cert.getEncoded(); } else return null; return new CERTRecord(name, dclass, ttl, type,...
[ "public", "static", "CERTRecord", "buildRecord", "(", "Name", "name", ",", "int", "dclass", ",", "long", "ttl", ",", "Certificate", "cert", ",", "int", "tag", ",", "int", "alg", ")", "{", "int", "type", ";", "byte", "[", "]", "data", ";", "try", "{",...
Builds a CERT record from a Certificate associated with a key also in DNS
[ "Builds", "a", "CERT", "record", "from", "a", "Certificate", "associated", "with", "a", "key", "also", "in", "DNS" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/CERTConverter.java#L56-L78
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/CERTConverter.java
CERTConverter.buildRecord
public static CERTRecord buildRecord(Name name, int dclass, long ttl, Certificate cert) { return buildRecord(name, dclass, ttl, cert, 0, 0); }
java
public static CERTRecord buildRecord(Name name, int dclass, long ttl, Certificate cert) { return buildRecord(name, dclass, ttl, cert, 0, 0); }
[ "public", "static", "CERTRecord", "buildRecord", "(", "Name", "name", ",", "int", "dclass", ",", "long", "ttl", ",", "Certificate", "cert", ")", "{", "return", "buildRecord", "(", "name", ",", "dclass", ",", "ttl", ",", "cert", ",", "0", ",", "0", ")",...
Builds a CERT record from a Certificate
[ "Builds", "a", "CERT", "record", "from", "a", "Certificate" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/CERTConverter.java#L81-L84
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ByteArrayPool.java
ByteArrayPool.getByteArray
public static byte[] getByteArray(int size) { byte[][] pool = (byte[][])__pools.get(); boolean full=true; for (int i=pool.length;i-->0;) { if (pool[i]!=null && pool[i].length==size) { byte[]b = pool[i]; pool[i]=null; ...
java
public static byte[] getByteArray(int size) { byte[][] pool = (byte[][])__pools.get(); boolean full=true; for (int i=pool.length;i-->0;) { if (pool[i]!=null && pool[i].length==size) { byte[]b = pool[i]; pool[i]=null; ...
[ "public", "static", "byte", "[", "]", "getByteArray", "(", "int", "size", ")", "{", "byte", "[", "]", "[", "]", "pool", "=", "(", "byte", "[", "]", "[", "]", ")", "__pools", ".", "get", "(", ")", ";", "boolean", "full", "=", "true", ";", "for",...
Get a byte array from the pool of known size. @param size Size of the byte array. @return Byte array of known size.
[ "Get", "a", "byte", "array", "from", "the", "pool", "of", "known", "size", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ByteArrayPool.java#L39-L60
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/QuotedStringTokenizer.java
QuotedStringTokenizer.quote
public static String quote(String s, String delim) { if (s==null) return null; if (s.length()==0) return "\"\""; for (int i=0;i<s.length();i++) { char c = s.charAt(i); if (c=='"' || c=='\\' || c...
java
public static String quote(String s, String delim) { if (s==null) return null; if (s.length()==0) return "\"\""; for (int i=0;i<s.length();i++) { char c = s.charAt(i); if (c=='"' || c=='\\' || c...
[ "public", "static", "String", "quote", "(", "String", "s", ",", "String", "delim", ")", "{", "if", "(", "s", "==", "null", ")", "return", "null", ";", "if", "(", "s", ".", "length", "(", ")", "==", "0", ")", "return", "\"\\\"\\\"\"", ";", "for", ...
Quote a string. The string is quoted only if quoting is required due to embeded delimiters, quote characters or the empty string. @param s The string to quote. @return quoted string
[ "Quote", "a", "string", ".", "The", "string", "is", "quoted", "only", "if", "quoting", "is", "required", "due", "to", "embeded", "delimiters", "quote", "characters", "or", "the", "empty", "string", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/QuotedStringTokenizer.java#L267-L290
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/QuotedStringTokenizer.java
QuotedStringTokenizer.quote
public static void quote(StringBuffer buf, String s) { synchronized(buf) { buf.append('"'); for (int i=0;i<s.length();i++) { char c = s.charAt(i); if (c=='"') { buf.append("\\\""); ...
java
public static void quote(StringBuffer buf, String s) { synchronized(buf) { buf.append('"'); for (int i=0;i<s.length();i++) { char c = s.charAt(i); if (c=='"') { buf.append("\\\""); ...
[ "public", "static", "void", "quote", "(", "StringBuffer", "buf", ",", "String", "s", ")", "{", "synchronized", "(", "buf", ")", "{", "buf", ".", "append", "(", "'", "'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s", ".", "leng...
Quote a string into a StringBuffer. @param buf The StringBuffer @param s The String to quote.
[ "Quote", "a", "string", "into", "a", "StringBuffer", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/QuotedStringTokenizer.java#L297-L320
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.truncate
public void truncate(int offset) throws IOException { if ((offset < 0)||(offset > _write_pos)) throw new IOException("bad truncate offset"); if (_read_pos > offset) _read_pos = offset; if (_mark_pos > offset) _mark_pos = offset; _write_pos = offset; if (_file_high > offset) _file...
java
public void truncate(int offset) throws IOException { if ((offset < 0)||(offset > _write_pos)) throw new IOException("bad truncate offset"); if (_read_pos > offset) _read_pos = offset; if (_mark_pos > offset) _mark_pos = offset; _write_pos = offset; if (_file_high > offset) _file...
[ "public", "void", "truncate", "(", "int", "offset", ")", "throws", "IOException", "{", "if", "(", "(", "offset", "<", "0", ")", "||", "(", "offset", ">", "_write_pos", ")", ")", "throw", "new", "IOException", "(", "\"bad truncate offset\"", ")", ";", "if...
Truncates buffered data to specified size. Can not be used to extend data. Repositions OutputStream at the end of truncated data. If current read offset or mark is past the new end of data, it is moved at the new end.
[ "Truncates", "buffered", "data", "to", "specified", "size", ".", "Can", "not", "be", "used", "to", "extend", "data", ".", "Repositions", "OutputStream", "at", "the", "end", "of", "truncated", "data", ".", "If", "current", "read", "offset", "or", "mark", "i...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L167-L174
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.setTempDirectory
public void setTempDirectory(File dir) throws IOException { File td = dir.getCanonicalFile(); if (td.isDirectory()) { _temp_directory = td; } }
java
public void setTempDirectory(File dir) throws IOException { File td = dir.getCanonicalFile(); if (td.isDirectory()) { _temp_directory = td; } }
[ "public", "void", "setTempDirectory", "(", "File", "dir", ")", "throws", "IOException", "{", "File", "td", "=", "dir", ".", "getCanonicalFile", "(", ")", ";", "if", "(", "td", ".", "isDirectory", "(", ")", ")", "{", "_temp_directory", "=", "td", ";", "...
Override directory to create temporary file in. Does not affect already open temp file. @param dir File object representing temporary directory. May be null which means that system default (java.io.tmpdir system property) should be used. @throws IOException
[ "Override", "directory", "to", "create", "temporary", "file", "in", ".", "Does", "not", "affect", "already", "open", "temp", "file", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L185-L190
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.getString
public String getString(String character_encoding) throws java.io.UnsupportedEncodingException { if (_file_mode) throw new IllegalStateException("data too large"); return new String(_memory_buffer,0,_write_pos,character_encoding); }
java
public String getString(String character_encoding) throws java.io.UnsupportedEncodingException { if (_file_mode) throw new IllegalStateException("data too large"); return new String(_memory_buffer,0,_write_pos,character_encoding); }
[ "public", "String", "getString", "(", "String", "character_encoding", ")", "throws", "java", ".", "io", ".", "UnsupportedEncodingException", "{", "if", "(", "_file_mode", ")", "throw", "new", "IllegalStateException", "(", "\"data too large\"", ")", ";", "return", ...
Returns buffered data as String using given character encoding. @param character_encoding Name of character encoding to use for converting bytes to String. @return Buffered data as String. @throws IllegalStateException when data is too large to be read this way. @throws java.io.UnsupportedEncodingException when this en...
[ "Returns", "buffered", "data", "as", "String", "using", "given", "character", "encoding", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L242-L245
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.getInputStream
public java.io.InputStream getInputStream() { if (_input_stream == null) { _input_stream = new TempByteHolder.InputStream(); } return _input_stream; }
java
public java.io.InputStream getInputStream() { if (_input_stream == null) { _input_stream = new TempByteHolder.InputStream(); } return _input_stream; }
[ "public", "java", ".", "io", ".", "InputStream", "getInputStream", "(", ")", "{", "if", "(", "_input_stream", "==", "null", ")", "{", "_input_stream", "=", "new", "TempByteHolder", ".", "InputStream", "(", ")", ";", "}", "return", "_input_stream", ";", "}"...
Returns InputSream for reading buffered data. @return InputSream for reading buffered data.
[ "Returns", "InputSream", "for", "reading", "buffered", "data", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L261-L266
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.writeTo
public void writeTo(java.io.OutputStream os, int start_offset, int length) throws IOException { int towrite = min(length, _write_pos-start_offset); int writeoff = start_offset; if (towrite > 0) { while (towrite >= _window_size) { moveWindow(writeoff); ...
java
public void writeTo(java.io.OutputStream os, int start_offset, int length) throws IOException { int towrite = min(length, _write_pos-start_offset); int writeoff = start_offset; if (towrite > 0) { while (towrite >= _window_size) { moveWindow(writeoff); ...
[ "public", "void", "writeTo", "(", "java", ".", "io", ".", "OutputStream", "os", ",", "int", "start_offset", ",", "int", "length", ")", "throws", "IOException", "{", "int", "towrite", "=", "min", "(", "length", ",", "_write_pos", "-", "start_offset", ")", ...
Writes efficiently part of the content to output stream. @param os OutputStream to write to @param start_offset Offset of data fragment to be written @param length Length of data fragment to be written @throws IOException
[ "Writes", "efficiently", "part", "of", "the", "content", "to", "output", "stream", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L286-L301
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.readFrom
public void readFrom(java.io.InputStream is) throws IOException { int howmuch = 0; do { _write_pos += howmuch; moveWindow(_write_pos); howmuch = is.read(_memory_buffer); } while (howmuch != -1); }
java
public void readFrom(java.io.InputStream is) throws IOException { int howmuch = 0; do { _write_pos += howmuch; moveWindow(_write_pos); howmuch = is.read(_memory_buffer); } while (howmuch != -1); }
[ "public", "void", "readFrom", "(", "java", ".", "io", ".", "InputStream", "is", ")", "throws", "IOException", "{", "int", "howmuch", "=", "0", ";", "do", "{", "_write_pos", "+=", "howmuch", ";", "moveWindow", "(", "_write_pos", ")", ";", "howmuch", "=", ...
Reads all available data from input stream. @param is @throws IOException
[ "Reads", "all", "available", "data", "from", "input", "stream", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L309-L316
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.createTempFile
private void createTempFile() throws IOException { _tempfilef = File.createTempFile("org.browsermob.proxy.jetty.util.TempByteHolder-",".tmp",_temp_directory).getCanonicalFile(); _tempfilef.deleteOnExit(); _tempfile = new RandomAccessFile(_tempfilef,"rw"); }
java
private void createTempFile() throws IOException { _tempfilef = File.createTempFile("org.browsermob.proxy.jetty.util.TempByteHolder-",".tmp",_temp_directory).getCanonicalFile(); _tempfilef.deleteOnExit(); _tempfile = new RandomAccessFile(_tempfilef,"rw"); }
[ "private", "void", "createTempFile", "(", ")", "throws", "IOException", "{", "_tempfilef", "=", "File", ".", "createTempFile", "(", "\"org.browsermob.proxy.jetty.util.TempByteHolder-\"", ",", "\".tmp\"", ",", "_temp_directory", ")", ".", "getCanonicalFile", "(", ")", ...
Create tempfile if it does not already exist
[ "Create", "tempfile", "if", "it", "does", "not", "already", "exist" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L324-L328
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.writeToTempFile
private void writeToTempFile(int at_offset, byte[] data, int offset, int len) throws IOException { if (_tempfile == null) { createTempFile(); _file_pos = -1; } _file_mode = true; if (at_offset != _file_pos) { _tempfile.seek((long)at_offset); } ...
java
private void writeToTempFile(int at_offset, byte[] data, int offset, int len) throws IOException { if (_tempfile == null) { createTempFile(); _file_pos = -1; } _file_mode = true; if (at_offset != _file_pos) { _tempfile.seek((long)at_offset); } ...
[ "private", "void", "writeToTempFile", "(", "int", "at_offset", ",", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "_tempfile", "==", "null", ")", "{", "createTempFile", "(", ")", ";", "...
Write chunk of data at specified offset in temp file. Marks data as big. Updates high water mark on tempfile content.
[ "Write", "chunk", "of", "data", "at", "specified", "offset", "in", "temp", "file", ".", "Marks", "data", "as", "big", ".", "Updates", "high", "water", "mark", "on", "tempfile", "content", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L335-L347
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.readFromTempFile
private void readFromTempFile(int at_offset, byte[] data, int offset, int len) throws IOException { if (_file_pos != at_offset) { _tempfile.seek((long)at_offset); } _tempfile.readFully(data,offset,len); _file_pos = at_offset+len; }
java
private void readFromTempFile(int at_offset, byte[] data, int offset, int len) throws IOException { if (_file_pos != at_offset) { _tempfile.seek((long)at_offset); } _tempfile.readFully(data,offset,len); _file_pos = at_offset+len; }
[ "private", "void", "readFromTempFile", "(", "int", "at_offset", ",", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "len", ")", "throws", "IOException", "{", "if", "(", "_file_pos", "!=", "at_offset", ")", "{", "_tempfile", ".", "seek", "(",...
Read chunk of data from specified offset in tempfile
[ "Read", "chunk", "of", "data", "from", "specified", "offset", "in", "tempfile" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L352-L358
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java
TempByteHolder.min
private static int min(int a, int b, int c) { int r = a; if (r > b) r = b; if (r > c) r = c; return r; }
java
private static int min(int a, int b, int c) { int r = a; if (r > b) r = b; if (r > c) r = c; return r; }
[ "private", "static", "int", "min", "(", "int", "a", ",", "int", "b", ",", "int", "c", ")", "{", "int", "r", "=", "a", ";", "if", "(", "r", ">", "b", ")", "r", "=", "b", ";", "if", "(", "r", ">", "c", ")", "r", "=", "c", ";", "return", ...
Simple minimum for 3 ints
[ "Simple", "minimum", "for", "3", "ints" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/TempByteHolder.java#L427-L432
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.put
public synchronized Object put(Object pathSpec, Object object) { StringTokenizer tok = new StringTokenizer(pathSpec.toString(),__pathSpecSeparators); Object old =null; while (tok.hasMoreTokens()) { String spec=tok.nextToken(); if (!spec.s...
java
public synchronized Object put(Object pathSpec, Object object) { StringTokenizer tok = new StringTokenizer(pathSpec.toString(),__pathSpecSeparators); Object old =null; while (tok.hasMoreTokens()) { String spec=tok.nextToken(); if (!spec.s...
[ "public", "synchronized", "Object", "put", "(", "Object", "pathSpec", ",", "Object", "object", ")", "{", "StringTokenizer", "tok", "=", "new", "StringTokenizer", "(", "pathSpec", ".", "toString", "(", ")", ",", "__pathSpecSeparators", ")", ";", "Object", "old"...
Add a single path match to the PathMap. @param pathSpec The path specification, or comma separated list of path specifications. @param object The object the path maps to
[ "Add", "a", "single", "path", "match", "to", "the", "PathMap", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L149-L198
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.match
public Object match(String path) { Map.Entry entry = getMatch(path); if (entry!=null) return entry.getValue(); return null; }
java
public Object match(String path) { Map.Entry entry = getMatch(path); if (entry!=null) return entry.getValue(); return null; }
[ "public", "Object", "match", "(", "String", "path", ")", "{", "Map", ".", "Entry", "entry", "=", "getMatch", "(", "path", ")", ";", "if", "(", "entry", "!=", "null", ")", "return", "entry", ".", "getValue", "(", ")", ";", "return", "null", ";", "}"...
Get object matched by the path. @param path the path. @return Best matched object or null.
[ "Get", "object", "matched", "by", "the", "path", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L205-L211
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.getMatch
public Map.Entry getMatch(String path) { Map.Entry entry; if (path==null) return null; int l=path.indexOf(';'); if (l<0) { l=path.indexOf('?'); if (l<0) l=path.length(); } // try exact match ...
java
public Map.Entry getMatch(String path) { Map.Entry entry; if (path==null) return null; int l=path.indexOf(';'); if (l<0) { l=path.indexOf('?'); if (l<0) l=path.length(); } // try exact match ...
[ "public", "Map", ".", "Entry", "getMatch", "(", "String", "path", ")", "{", "Map", ".", "Entry", "entry", ";", "if", "(", "path", "==", "null", ")", "return", "null", ";", "int", "l", "=", "path", ".", "indexOf", "(", "'", "'", ")", ";", "if", ...
Get the entry mapped by the best specification. @param path the path. @return Map.Entry of the best matched or null.
[ "Get", "the", "entry", "mapped", "by", "the", "best", "specification", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L219-L263
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.getMatches
public List getMatches(String path) { Map.Entry entry; Object entries=null; if (path==null) return LazyList.getList(entries); int l=path.indexOf(';'); if (l<0) { l=path.indexOf('?'); if (l<0) l=path...
java
public List getMatches(String path) { Map.Entry entry; Object entries=null; if (path==null) return LazyList.getList(entries); int l=path.indexOf(';'); if (l<0) { l=path.indexOf('?'); if (l<0) l=path...
[ "public", "List", "getMatches", "(", "String", "path", ")", "{", "Map", ".", "Entry", "entry", ";", "Object", "entries", "=", "null", ";", "if", "(", "path", "==", "null", ")", "return", "LazyList", ".", "getList", "(", "entries", ")", ";", "int", "l...
Get all entries matched by the path. Best match first. @param path Path to match @return List of Map.Entry instances key=pathSpec
[ "Get", "all", "entries", "matched", "by", "the", "path", ".", "Best", "match", "first", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L271-L325
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.pathMatch
public static String pathMatch(String pathSpec, String path) { char c = pathSpec.charAt(0); if (c=='/') { if (pathSpec.length()==1) return path; if (pathSpec.equals(path)) return path; if (pa...
java
public static String pathMatch(String pathSpec, String path) { char c = pathSpec.charAt(0); if (c=='/') { if (pathSpec.length()==1) return path; if (pathSpec.equals(path)) return path; if (pa...
[ "public", "static", "String", "pathMatch", "(", "String", "pathSpec", ",", "String", "path", ")", "{", "char", "c", "=", "pathSpec", ".", "charAt", "(", "0", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "if", "(", "pathSpec", ".", "length", ...
Return the portion of a path that matches a path spec. @return null if no match at all.
[ "Return", "the", "portion", "of", "a", "path", "that", "matches", "a", "path", "spec", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L422-L448
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.pathInfo
public static String pathInfo(String pathSpec, String path) { char c = pathSpec.charAt(0); if (c=='/') { if (pathSpec.length()==1) return null; if (pathSpec.equals(path)) return null; if (p...
java
public static String pathInfo(String pathSpec, String path) { char c = pathSpec.charAt(0); if (c=='/') { if (pathSpec.length()==1) return null; if (pathSpec.equals(path)) return null; if (p...
[ "public", "static", "String", "pathInfo", "(", "String", "pathSpec", ",", "String", "path", ")", "{", "char", "c", "=", "pathSpec", ".", "charAt", "(", "0", ")", ";", "if", "(", "c", "==", "'", "'", ")", "{", "if", "(", "pathSpec", ".", "length", ...
Return the portion of a path that is after a path spec. @return The path info string
[ "Return", "the", "portion", "of", "a", "path", "that", "is", "after", "a", "path", "spec", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L454-L475
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/PathMap.java
PathMap.relativePath
public static String relativePath(String base, String pathSpec, String path ) { String info=pathInfo(pathSpec,path); if (info==null) info=path; if( info.startsWith( "./")) info = info.substri...
java
public static String relativePath(String base, String pathSpec, String path ) { String info=pathInfo(pathSpec,path); if (info==null) info=path; if( info.startsWith( "./")) info = info.substri...
[ "public", "static", "String", "relativePath", "(", "String", "base", ",", "String", "pathSpec", ",", "String", "path", ")", "{", "String", "info", "=", "pathInfo", "(", "pathSpec", ",", "path", ")", ";", "if", "(", "info", "==", "null", ")", "info", "=...
Relative path. @param base The base the path is relative to. @param pathSpec The spec of the path segment to ignore. @param path the additional path @return base plus path with pathspec removed
[ "Relative", "path", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/PathMap.java#L485-L506
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/LogSupport.java
LogSupport.ignore
public static void ignore(Log log,Throwable th) { if (log.isTraceEnabled()) log.trace(IGNORED,th); }
java
public static void ignore(Log log,Throwable th) { if (log.isTraceEnabled()) log.trace(IGNORED,th); }
[ "public", "static", "void", "ignore", "(", "Log", "log", ",", "Throwable", "th", ")", "{", "if", "(", "log", ".", "isTraceEnabled", "(", ")", ")", "log", ".", "trace", "(", "IGNORED", ",", "th", ")", ";", "}" ]
Ignore an exception unless trace is enabled. This works around the problem that log4j does not support the trace level.
[ "Ignore", "an", "exception", "unless", "trace", "is", "enabled", ".", "This", "works", "around", "the", "problem", "that", "log4j", "does", "not", "support", "the", "trace", "level", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/LogSupport.java#L34-L37
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/security/DNSSECVerifier.java
DNSSECVerifier.verify
public int verify(RRset set, Cache cache) { Iterator sigs = set.sigs(); if (Options.check("verbosesec")) System.out.print("Verifying " + set.getName() + "/" + Type.string(set.getType()) + ": "); if (!sigs.hasNext()) { if (Options.check("verbosesec")) System.out.println("Insecure"); return DNSSEC.Insecu...
java
public int verify(RRset set, Cache cache) { Iterator sigs = set.sigs(); if (Options.check("verbosesec")) System.out.print("Verifying " + set.getName() + "/" + Type.string(set.getType()) + ": "); if (!sigs.hasNext()) { if (Options.check("verbosesec")) System.out.println("Insecure"); return DNSSEC.Insecu...
[ "public", "int", "verify", "(", "RRset", "set", ",", "Cache", "cache", ")", "{", "Iterator", "sigs", "=", "set", ".", "sigs", "(", ")", ";", "if", "(", "Options", ".", "check", "(", "\"verbosesec\"", ")", ")", "System", ".", "out", ".", "print", "(...
Attempts to verify an RRset. This does not modify the set. @param set The RRset to verify @param cache The Cache where obtained secure keys are found (may be null) @return The new security status of the set @see RRset
[ "Attempts", "to", "verify", "an", "RRset", ".", "This", "does", "not", "modify", "the", "set", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/security/DNSSECVerifier.java#L146-L168
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/DNSInput.java
DNSInput.readU16
public int readU16() throws WireParseException { require(2); int b1 = array[pos++] & 0xFF; int b2 = array[pos++] & 0xFF; return ((b1 << 8) + b2); }
java
public int readU16() throws WireParseException { require(2); int b1 = array[pos++] & 0xFF; int b2 = array[pos++] & 0xFF; return ((b1 << 8) + b2); }
[ "public", "int", "readU16", "(", ")", "throws", "WireParseException", "{", "require", "(", "2", ")", ";", "int", "b1", "=", "array", "[", "pos", "++", "]", "&", "0xFF", ";", "int", "b2", "=", "array", "[", "pos", "++", "]", "&", "0xFF", ";", "ret...
Reads an unsigned 16 bit value from the stream, as an int. @return An unsigned 16 bit value. @throws WireParseException The end of the stream was reached.
[ "Reads", "an", "unsigned", "16", "bit", "value", "from", "the", "stream", "as", "an", "int", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/DNSInput.java#L137-L143
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/DNSInput.java
DNSInput.readU32
public long readU32() throws WireParseException { require(4); int b1 = array[pos++] & 0xFF; int b2 = array[pos++] & 0xFF; int b3 = array[pos++] & 0xFF; int b4 = array[pos++] & 0xFF; return (((long)b1 << 24) + (b2 << 16) + (b3 << 8) + b4); }
java
public long readU32() throws WireParseException { require(4); int b1 = array[pos++] & 0xFF; int b2 = array[pos++] & 0xFF; int b3 = array[pos++] & 0xFF; int b4 = array[pos++] & 0xFF; return (((long)b1 << 24) + (b2 << 16) + (b3 << 8) + b4); }
[ "public", "long", "readU32", "(", ")", "throws", "WireParseException", "{", "require", "(", "4", ")", ";", "int", "b1", "=", "array", "[", "pos", "++", "]", "&", "0xFF", ";", "int", "b2", "=", "array", "[", "pos", "++", "]", "&", "0xFF", ";", "in...
Reads an unsigned 32 bit value from the stream, as a long. @return An unsigned 32 bit value. @throws WireParseException The end of the stream was reached.
[ "Reads", "an", "unsigned", "32", "bit", "value", "from", "the", "stream", "as", "a", "long", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/DNSInput.java#L150-L158
train
webmetrics/browsermob-proxy
src/main/java/org/java_bandwidthlimiter/StreamManager.java
StreamManager.simulate
private static long simulate(long bytesPerSecond, long latency, int bytes, long timeTaken, boolean roundUp) { if ( bytesPerSecond <= 0) { //< defensive code return 0; } // workout how much we should have waited to read this amount of bytes double d = ((double) bytes / bytesP...
java
private static long simulate(long bytesPerSecond, long latency, int bytes, long timeTaken, boolean roundUp) { if ( bytesPerSecond <= 0) { //< defensive code return 0; } // workout how much we should have waited to read this amount of bytes double d = ((double) bytes / bytesP...
[ "private", "static", "long", "simulate", "(", "long", "bytesPerSecond", ",", "long", "latency", ",", "int", "bytes", ",", "long", "timeTaken", ",", "boolean", "roundUp", ")", "{", "if", "(", "bytesPerSecond", "<=", "0", ")", "{", "//< defensive code", "retur...
to adjust the waiting time
[ "to", "adjust", "the", "waiting", "time" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/java_bandwidthlimiter/StreamManager.java#L354-L369
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java
CertificateCreator.mitmDuplicateCertificate
public static X509Certificate mitmDuplicateCertificate(final X509Certificate originalCert, final PublicKey newPubKey, final X509Certificate caCert, final PrivateKey caPrivateKey, Set<String> extensionOidsNotToCopy) throws CertificateParsingException, SignatureException, InvalidKeyException, Certi...
java
public static X509Certificate mitmDuplicateCertificate(final X509Certificate originalCert, final PublicKey newPubKey, final X509Certificate caCert, final PrivateKey caPrivateKey, Set<String> extensionOidsNotToCopy) throws CertificateParsingException, SignatureException, InvalidKeyException, Certi...
[ "public", "static", "X509Certificate", "mitmDuplicateCertificate", "(", "final", "X509Certificate", "originalCert", ",", "final", "PublicKey", "newPubKey", ",", "final", "X509Certificate", "caCert", ",", "final", "PrivateKey", "caPrivateKey", ",", "Set", "<", "String", ...
This method creates an X509v3 certificate based on an an existing certificate. It attempts to create as faithful a copy of the existing certificate as possible by duplicating all certificate extensions. If you are testing an application that makes use of additional certificate extensions (e.g. logotype, S/MIME capabil...
[ "This", "method", "creates", "an", "X509v3", "certificate", "based", "on", "an", "an", "existing", "certificate", ".", "It", "attempts", "to", "create", "as", "faithful", "a", "copy", "of", "the", "existing", "certificate", "as", "possible", "by", "duplicating...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java#L242-L311
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java
CertificateCreator.mitmDuplicateCertificate
public static X509Certificate mitmDuplicateCertificate(final X509Certificate originalCert, final PublicKey newPubKey, final X509Certificate caCert, final PrivateKey caPrivateKey) throws CertificateParsingException, SignatureException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidExc...
java
public static X509Certificate mitmDuplicateCertificate(final X509Certificate originalCert, final PublicKey newPubKey, final X509Certificate caCert, final PrivateKey caPrivateKey) throws CertificateParsingException, SignatureException, InvalidKeyException, CertificateExpiredException, CertificateNotYetValidExc...
[ "public", "static", "X509Certificate", "mitmDuplicateCertificate", "(", "final", "X509Certificate", "originalCert", ",", "final", "PublicKey", "newPubKey", ",", "final", "X509Certificate", "caCert", ",", "final", "PrivateKey", "caPrivateKey", ")", "throws", "CertificatePa...
Convenience method for the most common case of certificate duplication. This method will not add any custom extensions and won't copy the extensions 2.5.29.8 : Issuer Alternative Name, 2.5.29.18 : Issuer Alternative Name 2, 2.5.29.31 : CRL Distribution Point or 1.3.6.1.5.5.7.1.1 : Authority Info Access, if they are pr...
[ "Convenience", "method", "for", "the", "most", "common", "case", "of", "certificate", "duplication", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/selenium/CertificateCreator.java#L333-L340
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/IO.java
IO.copyThread
public static void copyThread(InputStream in, OutputStream out) { try{ instance().run(new Job(in,out)); } catch(InterruptedException e) { log.warn(LogSupport.EXCEPTION,e); } }
java
public static void copyThread(InputStream in, OutputStream out) { try{ instance().run(new Job(in,out)); } catch(InterruptedException e) { log.warn(LogSupport.EXCEPTION,e); } }
[ "public", "static", "void", "copyThread", "(", "InputStream", "in", ",", "OutputStream", "out", ")", "{", "try", "{", "instance", "(", ")", ".", "run", "(", "new", "Job", "(", "in", ",", "out", ")", ")", ";", "}", "catch", "(", "InterruptedException", ...
Copy Stream in to Stream out until EOF or exception. in own thread
[ "Copy", "Stream", "in", "to", "Stream", "out", "until", "EOF", "or", "exception", ".", "in", "own", "thread" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/IO.java#L86-L95
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/IO.java
IO.copyThread
public static void copyThread(Reader in, Writer out) { try { instance().run(new Job(in,out)); } catch(InterruptedException e) { log.warn(LogSupport.EXCEPTION,e); } }
java
public static void copyThread(Reader in, Writer out) { try { instance().run(new Job(in,out)); } catch(InterruptedException e) { log.warn(LogSupport.EXCEPTION,e); } }
[ "public", "static", "void", "copyThread", "(", "Reader", "in", ",", "Writer", "out", ")", "{", "try", "{", "instance", "(", ")", ".", "run", "(", "new", "Job", "(", "in", ",", "out", ")", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")...
Copy Stream in to Stream out until EOF or exception in own thread
[ "Copy", "Stream", "in", "to", "Stream", "out", "until", "EOF", "or", "exception", "in", "own", "thread" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/IO.java#L110-L120
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/IO.java
IO.copy
public static void copy(Reader in, Writer out, long byteCount) throws IOException { char buffer[] = new char[bufferSize]; int len=bufferSize; if (byteCount>=0) { while (byteCount>0) { ...
java
public static void copy(Reader in, Writer out, long byteCount) throws IOException { char buffer[] = new char[bufferSize]; int len=bufferSize; if (byteCount>=0) { while (byteCount>0) { ...
[ "public", "static", "void", "copy", "(", "Reader", "in", ",", "Writer", "out", ",", "long", "byteCount", ")", "throws", "IOException", "{", "char", "buffer", "[", "]", "=", "new", "char", "[", "bufferSize", "]", ";", "int", "len", "=", "bufferSize", ";...
Copy Reader to Writer for byteCount bytes or until EOF or exception.
[ "Copy", "Reader", "to", "Writer", "for", "byteCount", "bytes", "or", "until", "EOF", "or", "exception", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/IO.java#L175-L209
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/TSIG.java
TSIG.fromString
static public TSIG fromString(String str) { String [] parts = str.split("[:/]"); if (parts.length < 2 || parts.length > 3) throw new IllegalArgumentException("Invalid TSIG key " + "specification"); if (parts.length == 3) return new TSIG(parts[0], parts[1], parts[2]); else return new TSIG(HMAC_MD5, pa...
java
static public TSIG fromString(String str) { String [] parts = str.split("[:/]"); if (parts.length < 2 || parts.length > 3) throw new IllegalArgumentException("Invalid TSIG key " + "specification"); if (parts.length == 3) return new TSIG(parts[0], parts[1], parts[2]); else return new TSIG(HMAC_MD5, pa...
[ "static", "public", "TSIG", "fromString", "(", "String", "str", ")", "{", "String", "[", "]", "parts", "=", "str", ".", "split", "(", "\"[:/]\"", ")", ";", "if", "(", "parts", ".", "length", "<", "2", "||", "parts", ".", "length", ">", "3", ")", ...
Creates a new TSIG object with the hmac-md5 algorithm, which can be used to sign or verify a message. @param str The TSIG key, in the form name:secret, name/secret, alg:name:secret, or alg/name/secret. If an algorithm is specified, it must be "hmac-md5", "hmac-sha1", or "hmac-sha256". @throws IllegalArgumentException ...
[ "Creates", "a", "new", "TSIG", "object", "with", "the", "hmac", "-", "md5", "algorithm", "which", "can", "be", "used", "to", "sign", "or", "verify", "a", "message", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/TSIG.java#L151-L161
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/DateCache.java
DateCache.setTimeZone
public void setTimeZone(TimeZone tz) { setTzFormatString(tz); if( _locale != null ) { _tzFormat=new SimpleDateFormat(_tzFormatString,_locale); _minFormat=new SimpleDateFormat(_minFormatString,_locale); } else if( _dfs != null ) { ...
java
public void setTimeZone(TimeZone tz) { setTzFormatString(tz); if( _locale != null ) { _tzFormat=new SimpleDateFormat(_tzFormatString,_locale); _minFormat=new SimpleDateFormat(_minFormatString,_locale); } else if( _dfs != null ) { ...
[ "public", "void", "setTimeZone", "(", "TimeZone", "tz", ")", "{", "setTzFormatString", "(", "tz", ")", ";", "if", "(", "_locale", "!=", "null", ")", "{", "_tzFormat", "=", "new", "SimpleDateFormat", "(", "_tzFormatString", ",", "_locale", ")", ";", "_minFo...
Set the timezone. @param tz TimeZone
[ "Set", "the", "timezone", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/DateCache.java#L111-L133
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/DateCache.java
DateCache.format
public synchronized String format(long inDate) { long seconds = inDate / 1000; // Is it not suitable to cache? if (seconds<_lastSeconds || _lastSeconds>0 && seconds>_lastSeconds+__hitWindow) { // It's a cache miss _misses++; if (_misse...
java
public synchronized String format(long inDate) { long seconds = inDate / 1000; // Is it not suitable to cache? if (seconds<_lastSeconds || _lastSeconds>0 && seconds>_lastSeconds+__hitWindow) { // It's a cache miss _misses++; if (_misse...
[ "public", "synchronized", "String", "format", "(", "long", "inDate", ")", "{", "long", "seconds", "=", "inDate", "/", "1000", ";", "// Is it not suitable to cache?", "if", "(", "seconds", "<", "_lastSeconds", "||", "_lastSeconds", ">", "0", "&&", "seconds", ">...
Format a date according to our stored formatter. @param inDate @return Formatted date
[ "Format", "a", "date", "according", "to", "our", "stored", "formatter", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/DateCache.java#L228-L303
train
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/OPTRecord.java
OPTRecord.getOptions
public List getOptions(int code) { if (options == null) return Collections.EMPTY_LIST; List list = null; for (Iterator it = options.iterator(); it.hasNext(); ) { Option opt = (Option) it.next(); if (opt.code == code) { if (list == null) list = new ArrayList(); list.add(opt.data); } } if (list == ...
java
public List getOptions(int code) { if (options == null) return Collections.EMPTY_LIST; List list = null; for (Iterator it = options.iterator(); it.hasNext(); ) { Option opt = (Option) it.next(); if (opt.code == code) { if (list == null) list = new ArrayList(); list.add(opt.data); } } if (list == ...
[ "public", "List", "getOptions", "(", "int", "code", ")", "{", "if", "(", "options", "==", "null", ")", "return", "Collections", ".", "EMPTY_LIST", ";", "List", "list", "=", "null", ";", "for", "(", "Iterator", "it", "=", "options", ".", "iterator", "("...
Gets all options in the OPTRecord with a specific code. This returns a list of byte arrays.
[ "Gets", "all", "options", "in", "the", "OPTRecord", "with", "a", "specific", "code", ".", "This", "returns", "a", "list", "of", "byte", "arrays", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/OPTRecord.java#L203-L219
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/SocketListener.java
SocketListener.createConnection
protected HttpConnection createConnection(Socket socket) throws IOException { HttpConnection c = new HttpConnection(this, socket.getInetAddress(), socket.getInputStream(), socket.getOutputStream(), ...
java
protected HttpConnection createConnection(Socket socket) throws IOException { HttpConnection c = new HttpConnection(this, socket.getInetAddress(), socket.getInputStream(), socket.getOutputStream(), ...
[ "protected", "HttpConnection", "createConnection", "(", "Socket", "socket", ")", "throws", "IOException", "{", "HttpConnection", "c", "=", "new", "HttpConnection", "(", "this", ",", "socket", ".", "getInetAddress", "(", ")", ",", "socket", ".", "getInputStream", ...
Create an HttpConnection instance. This method can be used to override the connection instance. @param socket The underlying socket.
[ "Create", "an", "HttpConnection", "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/SocketListener.java#L253-L262
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/SocketListener.java
SocketListener.persistConnection
public void persistConnection(HttpConnection connection) { try { Socket socket=(Socket)(connection.getConnection()); if (_lowResourcePersistTimeMs>0 && isLowOnResources()) { socket.setSoTimeout(_lowResourcePersistTimeMs); connectio...
java
public void persistConnection(HttpConnection connection) { try { Socket socket=(Socket)(connection.getConnection()); if (_lowResourcePersistTimeMs>0 && isLowOnResources()) { socket.setSoTimeout(_lowResourcePersistTimeMs); connectio...
[ "public", "void", "persistConnection", "(", "HttpConnection", "connection", ")", "{", "try", "{", "Socket", "socket", "=", "(", "Socket", ")", "(", "connection", ".", "getConnection", "(", ")", ")", ";", "if", "(", "_lowResourcePersistTimeMs", ">", "0", "&&"...
Persist the connection. This method is called by the HttpConnection in order to prepare a connection to be persisted. For this implementation, if the listener is low on resources, the connection read timeout is set to lowResourcePersistTimeMs. The customizeRequest method is used to reset this to the normal value after...
[ "Persist", "the", "connection", ".", "This", "method", "is", "called", "by", "the", "HttpConnection", "in", "order", "to", "prepare", "a", "connection", "to", "be", "persisted", ".", "For", "this", "implementation", "if", "the", "listener", "is", "low", "on"...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/SocketListener.java#L318-L336
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpInputStream.java
HttpInputStream.resetStream
public void resetStream() throws IllegalStateException { if ((_deChunker!=null && _deChunker._chunkSize>0) || _realIn.getByteLimit()>0) throw new IllegalStateException("Unread input"); if(log.isTraceEnabled())log.trace("resetStream()"); in=_realIn; if ...
java
public void resetStream() throws IllegalStateException { if ((_deChunker!=null && _deChunker._chunkSize>0) || _realIn.getByteLimit()>0) throw new IllegalStateException("Unread input"); if(log.isTraceEnabled())log.trace("resetStream()"); in=_realIn; if ...
[ "public", "void", "resetStream", "(", ")", "throws", "IllegalStateException", "{", "if", "(", "(", "_deChunker", "!=", "null", "&&", "_deChunker", ".", "_chunkSize", ">", "0", ")", "||", "_realIn", ".", "getByteLimit", "(", ")", ">", "0", ")", "throw", "...
Reset the stream. Turn chunking off and disable all filters. @exception IllegalStateException The stream cannot be reset if there is some unread chunked input or a content length greater than zero remaining.
[ "Reset", "the", "stream", ".", "Turn", "chunking", "off", "and", "disable", "all", "filters", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpInputStream.java#L225-L237
train
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpInputStream.java
HttpInputStream.setContentLength
public void setContentLength(int len) { if (_chunking && len>=0 && getExpectContinues()==null) throw new IllegalStateException("Chunking"); _realIn.setByteLimit(len); }
java
public void setContentLength(int len) { if (_chunking && len>=0 && getExpectContinues()==null) throw new IllegalStateException("Chunking"); _realIn.setByteLimit(len); }
[ "public", "void", "setContentLength", "(", "int", "len", ")", "{", "if", "(", "_chunking", "&&", "len", ">=", "0", "&&", "getExpectContinues", "(", ")", "==", "null", ")", "throw", "new", "IllegalStateException", "(", "\"Chunking\"", ")", ";", "_realIn", "...
Set the content length. Only this number of bytes can be read before EOF is returned. @param len length.
[ "Set", "the", "content", "length", ".", "Only", "this", "number", "of", "bytes", "can", "be", "read", "before", "EOF", "is", "returned", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpInputStream.java#L252-L257
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.fetchMetadata
public void fetchMetadata(final String uuid, final DataSetMetadataCallback listener) throws Exception { final DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid); if (metadata != null) { listener.callback(metadata); } else if (dataS...
java
public void fetchMetadata(final String uuid, final DataSetMetadataCallback listener) throws Exception { final DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid); if (metadata != null) { listener.callback(metadata); } else if (dataS...
[ "public", "void", "fetchMetadata", "(", "final", "String", "uuid", ",", "final", "DataSetMetadataCallback", "listener", ")", "throws", "Exception", "{", "final", "DataSetMetadata", "metadata", "=", "clientDataSetManager", ".", "getDataSetMetadata", "(", "uuid", ")", ...
Fetch the metadata instance for the specified data set. @param uuid The UUID of the data set @throws Exception It there is an unexpected error trying to execute the lookup request.
[ "Fetch", "the", "metadata", "instance", "for", "the", "specified", "data", "set", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L131-L157
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.getMetadata
public DataSetMetadata getMetadata(String uuid) { DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid); if (metadata != null) { return metadata; } return remoteMetadataMap.get(uuid); }
java
public DataSetMetadata getMetadata(String uuid) { DataSetMetadata metadata = clientDataSetManager.getDataSetMetadata(uuid); if (metadata != null) { return metadata; } return remoteMetadataMap.get(uuid); }
[ "public", "DataSetMetadata", "getMetadata", "(", "String", "uuid", ")", "{", "DataSetMetadata", "metadata", "=", "clientDataSetManager", ".", "getDataSetMetadata", "(", "uuid", ")", ";", "if", "(", "metadata", "!=", "null", ")", "{", "return", "metadata", ";", ...
Get the cached metadata instance for the specified data set. @param uuid The UUID of the data set. Null if the metadata is not stored on client yet.
[ "Get", "the", "cached", "metadata", "instance", "for", "the", "specified", "data", "set", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L168-L175
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.exportDataSetCSV
public void exportDataSetCSV(final DataSetLookup request, final DataSetExportReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request.getD...
java
public void exportDataSetCSV(final DataSetLookup request, final DataSetExportReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request.getD...
[ "public", "void", "exportDataSetCSV", "(", "final", "DataSetLookup", "request", ",", "final", "DataSetExportReadyCallback", "listener", ")", "throws", "Exception", "{", "if", "(", "dataSetLookupServices", "!=", "null", ")", "{", "// Look always into the client data set ma...
Export a data set, specified by a data set lookup request, to CSV format. @param request The data set lookup request @throws Exception It there is an unexpected error during the export.
[ "Export", "a", "data", "set", "specified", "by", "a", "data", "set", "lookup", "request", "to", "CSV", "format", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L183-L230
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.exportDataSetExcel
public void exportDataSetExcel(final DataSetLookup request, final DataSetExportReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request....
java
public void exportDataSetExcel(final DataSetLookup request, final DataSetExportReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request....
[ "public", "void", "exportDataSetExcel", "(", "final", "DataSetLookup", "request", ",", "final", "DataSetExportReadyCallback", "listener", ")", "throws", "Exception", "{", "if", "(", "dataSetLookupServices", "!=", "null", ")", "{", "// Look always into the client data set ...
Export a data set, specified by a data set lookup request, to Excel format. @param request The data set lookup request @throws Exception It there is an unexpected error during the export.
[ "Export", "a", "data", "set", "specified", "by", "a", "data", "set", "lookup", "request", "to", "Excel", "format", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L238-L281
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.newDataSet
public void newDataSet(DataSetProviderType type, RemoteCallback<DataSetDef> callback) throws Exception { dataSetDefServices.call(callback).createDataSetDef(type); }
java
public void newDataSet(DataSetProviderType type, RemoteCallback<DataSetDef> callback) throws Exception { dataSetDefServices.call(callback).createDataSetDef(type); }
[ "public", "void", "newDataSet", "(", "DataSetProviderType", "type", ",", "RemoteCallback", "<", "DataSetDef", ">", "callback", ")", "throws", "Exception", "{", "dataSetDefServices", ".", "call", "(", "callback", ")", ".", "createDataSetDef", "(", "type", ")", ";...
Creates a brand new data set definition for the provider type specified @param type The provider type @return A data set definition instance
[ "Creates", "a", "brand", "new", "data", "set", "definition", "for", "the", "provider", "type", "specified" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L289-L292
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.lookupDataSet
public void lookupDataSet(final DataSetDef def, final DataSetLookup request, final DataSetReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { try { dataSetLookupServices.call( ...
java
public void lookupDataSet(final DataSetDef def, final DataSetLookup request, final DataSetReadyCallback listener) throws Exception { if (dataSetLookupServices != null) { try { dataSetLookupServices.call( ...
[ "public", "void", "lookupDataSet", "(", "final", "DataSetDef", "def", ",", "final", "DataSetLookup", "request", ",", "final", "DataSetReadyCallback", "listener", ")", "throws", "Exception", "{", "if", "(", "dataSetLookupServices", "!=", "null", ")", "{", "try", ...
Process the specified data set lookup request for a given definition. @param def The data set definition @param request The data set lookup request @throws Exception It there is an unexpected error trying to execute the lookup request.
[ "Process", "the", "specified", "data", "set", "lookup", "request", "for", "a", "given", "definition", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L301-L334
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java
DataSetClientServices.lookupDataSet
public void lookupDataSet(final DataSetLookup request, final DataSetReadyCallback listener) throws Exception { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request.getDataSetUUID()) != null) { DataSet dataSet = clientData...
java
public void lookupDataSet(final DataSetLookup request, final DataSetReadyCallback listener) throws Exception { // Look always into the client data set manager. if (clientDataSetManager.getDataSet(request.getDataSetUUID()) != null) { DataSet dataSet = clientData...
[ "public", "void", "lookupDataSet", "(", "final", "DataSetLookup", "request", ",", "final", "DataSetReadyCallback", "listener", ")", "throws", "Exception", "{", "// Look always into the client data set manager.", "if", "(", "clientDataSetManager", ".", "getDataSet", "(", "...
Process the specified data set lookup request. @param request The data set lookup request @throws Exception It there is an unexpected error trying to execute the lookup request.
[ "Process", "the", "specified", "data", "set", "lookup", "request", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java#L342-L403
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java
TableDisplayer.onFilterLabelRemoved
void onFilterLabelRemoved(String columnId, int row) { super.filterUpdate(columnId, row); // Update the displayer view in order to reflect the current selection // (only if not has already been redrawn in the previous filterUpdate() call) if (!displayerSettings.isFilterSelfApplyEnabled()...
java
void onFilterLabelRemoved(String columnId, int row) { super.filterUpdate(columnId, row); // Update the displayer view in order to reflect the current selection // (only if not has already been redrawn in the previous filterUpdate() call) if (!displayerSettings.isFilterSelfApplyEnabled()...
[ "void", "onFilterLabelRemoved", "(", "String", "columnId", ",", "int", "row", ")", "{", "super", ".", "filterUpdate", "(", "columnId", ",", "row", ")", ";", "// Update the displayer view in order to reflect the current selection", "// (only if not has already been redrawn in ...
Filter label set component notifications
[ "Filter", "label", "set", "component", "notifications" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java#L354-L362
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java
TableDisplayer.onFilterEnabled
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { view.gotoFirstPage(); super.onFilterEnabled(displayer, groupOp); }
java
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { view.gotoFirstPage(); super.onFilterEnabled(displayer, groupOp); }
[ "@", "Override", "public", "void", "onFilterEnabled", "(", "Displayer", "displayer", ",", "DataSetGroup", "groupOp", ")", "{", "view", ".", "gotoFirstPage", "(", ")", ";", "super", ".", "onFilterEnabled", "(", "displayer", ",", "groupOp", ")", ";", "}" ]
Reset the current navigation status on filter requests from external displayers
[ "Reset", "the", "current", "navigation", "status", "on", "filter", "requests", "from", "external", "displayers" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayer.java#L376-L380
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-displayer-screen/src/main/java/org/dashbuilder/displayer/client/PerspectiveCoordinator.java
PerspectiveCoordinator.editOn
public void editOn() { editOn = true; // Turns off the automatic refresh of all the displayers. for (Displayer displayer : displayerCoordinator.getDisplayerList()) { displayer.setRefreshOn(false); } }
java
public void editOn() { editOn = true; // Turns off the automatic refresh of all the displayers. for (Displayer displayer : displayerCoordinator.getDisplayerList()) { displayer.setRefreshOn(false); } }
[ "public", "void", "editOn", "(", ")", "{", "editOn", "=", "true", ";", "// Turns off the automatic refresh of all the displayers.", "for", "(", "Displayer", "displayer", ":", "displayerCoordinator", ".", "getDisplayerList", "(", ")", ")", "{", "displayer", ".", "set...
Turn on the edition of the perspective
[ "Turn", "on", "the", "edition", "of", "the", "perspective" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-screen/src/main/java/org/dashbuilder/displayer/client/PerspectiveCoordinator.java#L80-L87
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/selector/SelectorDisplayer.java
SelectorDisplayer.onFilterEnabled
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { String firstColumnId = dataSet.getColumnByIndex(0).getId(); List<Integer> currentFilter = super.filterIndexes(firstColumnId); // If selector is active then ignore external filters. if (currentFilter.i...
java
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { String firstColumnId = dataSet.getColumnByIndex(0).getId(); List<Integer> currentFilter = super.filterIndexes(firstColumnId); // If selector is active then ignore external filters. if (currentFilter.i...
[ "@", "Override", "public", "void", "onFilterEnabled", "(", "Displayer", "displayer", ",", "DataSetGroup", "groupOp", ")", "{", "String", "firstColumnId", "=", "dataSet", ".", "getColumnByIndex", "(", "0", ")", ".", "getId", "(", ")", ";", "List", "<", "Integ...
KEEP IN SYNC THE CURRENT SELECTION WITH ANY EXTERNAL FILTER
[ "KEEP", "IN", "SYNC", "THE", "CURRENT", "SELECTION", "WITH", "ANY", "EXTERNAL", "FILTER" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/selector/SelectorDisplayer.java#L181-L193
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleTableDisplayer.java
GoogleTableDisplayer.onFilterEnabled
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { currentPage = 1; super.onFilterEnabled(displayer, groupOp); }
java
@Override public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) { currentPage = 1; super.onFilterEnabled(displayer, groupOp); }
[ "@", "Override", "public", "void", "onFilterEnabled", "(", "Displayer", "displayer", ",", "DataSetGroup", "groupOp", ")", "{", "currentPage", "=", "1", ";", "super", ".", "onFilterEnabled", "(", "displayer", ",", "groupOp", ")", ";", "}" ]
Reset the current navigation status on filter requests from external displayers.
[ "Reset", "the", "current", "navigation", "status", "on", "filter", "requests", "from", "external", "displayers", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleTableDisplayer.java#L207-L211
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java
ColumnListEditor.onValueRestricted
@Override public void onValueRestricted(final String value) { this.restrictedColumns.add(value); setEditorEnabled(value, false, DataSetEditorConstants.INSTANCE.columnIsUsedInFilter()); }
java
@Override public void onValueRestricted(final String value) { this.restrictedColumns.add(value); setEditorEnabled(value, false, DataSetEditorConstants.INSTANCE.columnIsUsedInFilter()); }
[ "@", "Override", "public", "void", "onValueRestricted", "(", "final", "String", "value", ")", "{", "this", ".", "restrictedColumns", ".", "add", "(", "value", ")", ";", "setEditorEnabled", "(", "value", ",", "false", ",", "DataSetEditorConstants", ".", "INSTAN...
Set the column that cannot be removed from the list, as it's used by the filter. @param value The column id.
[ "Set", "the", "column", "that", "cannot", "be", "removed", "from", "the", "list", "as", "it", "s", "used", "by", "the", "filter", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java#L112-L116
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java
ColumnListEditor.onValueUnRestricted
@Override public void onValueUnRestricted(final String value) { this.restrictedColumns.remove(value); // Check single column used in data set -> it cannot be unselected. if (listEditor.getList().size() == 1) { setEditorEnabled(0 ,false, DataSetEditorConstants.INSTANCE.da...
java
@Override public void onValueUnRestricted(final String value) { this.restrictedColumns.remove(value); // Check single column used in data set -> it cannot be unselected. if (listEditor.getList().size() == 1) { setEditorEnabled(0 ,false, DataSetEditorConstants.INSTANCE.da...
[ "@", "Override", "public", "void", "onValueUnRestricted", "(", "final", "String", "value", ")", "{", "this", ".", "restrictedColumns", ".", "remove", "(", "value", ")", ";", "// Check single column used in data set -> it cannot be unselected.", "if", "(", "listEditor", ...
Set the column that can be removed again from the list, as it's no longer used by the filter. @param value The column id.
[ "Set", "the", "column", "that", "can", "be", "removed", "again", "from", "the", "list", "as", "it", "s", "no", "longer", "used", "by", "the", "filter", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java#L122-L132
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java
ColumnListEditor.checkSingleColumnEditorDisabled
private boolean checkSingleColumnEditorDisabled() { final int size = listEditor.getList().size(); final boolean hasEditors = !listEditor.getEditors().isEmpty(); if (size == 1 && hasEditors) { setEditorEnabled(0 ,false, DataSetEditorConstants.INSTANCE.dataSetMustHaveAtLeastOneColumn()...
java
private boolean checkSingleColumnEditorDisabled() { final int size = listEditor.getList().size(); final boolean hasEditors = !listEditor.getEditors().isEmpty(); if (size == 1 && hasEditors) { setEditorEnabled(0 ,false, DataSetEditorConstants.INSTANCE.dataSetMustHaveAtLeastOneColumn()...
[ "private", "boolean", "checkSingleColumnEditorDisabled", "(", ")", "{", "final", "int", "size", "=", "listEditor", ".", "getList", "(", ")", ".", "size", "(", ")", ";", "final", "boolean", "hasEditors", "=", "!", "listEditor", ".", "getEditors", "(", ")", ...
Checks that if only single column used in data set -> it cannot be unselected.
[ "Checks", "that", "if", "only", "single", "column", "used", "in", "data", "set", "-", ">", "it", "cannot", "be", "unselected", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java#L282-L290
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java
ColumnListEditor.checkMultipleColumnsEditorEnabled
private boolean checkMultipleColumnsEditorEnabled() { final int size = listEditor.getList().size(); if (size == 2 && !listEditor.getEditors().isEmpty()) { final String cId = listEditor.getEditors().get(0).id().getValue(); if (!restrictedColumns.contains(cId)) { se...
java
private boolean checkMultipleColumnsEditorEnabled() { final int size = listEditor.getList().size(); if (size == 2 && !listEditor.getEditors().isEmpty()) { final String cId = listEditor.getEditors().get(0).id().getValue(); if (!restrictedColumns.contains(cId)) { se...
[ "private", "boolean", "checkMultipleColumnsEditorEnabled", "(", ")", "{", "final", "int", "size", "=", "listEditor", ".", "getList", "(", ")", ".", "size", "(", ")", ";", "if", "(", "size", "==", "2", "&&", "!", "listEditor", ".", "getEditors", "(", ")",...
Checks that if multiple columns are used in data set -> the column editors must be enabed, if the columns are not are restricted.
[ "Checks", "that", "if", "multiple", "columns", "are", "used", "in", "data", "set", "-", ">", "the", "column", "editors", "must", "be", "enabed", "if", "the", "columns", "are", "not", "are", "restricted", "." ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-widgets/src/main/java/org/dashbuilder/client/widgets/dataset/editor/column/ColumnListEditor.java#L295-L305
train
dashbuilder/dashbuilder
dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettings.java
DisplayerSettings.setDisplayerSetting
public void setDisplayerSetting( DisplayerAttributeDef displayerAttributeDef, String value ) { settings.put(getSettingPath(displayerAttributeDef), value); }
java
public void setDisplayerSetting( DisplayerAttributeDef displayerAttributeDef, String value ) { settings.put(getSettingPath(displayerAttributeDef), value); }
[ "public", "void", "setDisplayerSetting", "(", "DisplayerAttributeDef", "displayerAttributeDef", ",", "String", "value", ")", "{", "settings", ".", "put", "(", "getSettingPath", "(", "displayerAttributeDef", ")", ",", "value", ")", ";", "}" ]
'Generic' setter method
[ "Generic", "setter", "method" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettings.java#L224-L226
train
dashbuilder/dashbuilder
dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettings.java
DisplayerSettings.removeDisplayerSetting
public void removeDisplayerSetting( DisplayerAttributeGroupDef displayerAttributeGroup ) { for (DisplayerAttributeDef attributeDef : displayerAttributeGroup.getChildren()) { settings.remove(getSettingPath(attributeDef)); } }
java
public void removeDisplayerSetting( DisplayerAttributeGroupDef displayerAttributeGroup ) { for (DisplayerAttributeDef attributeDef : displayerAttributeGroup.getChildren()) { settings.remove(getSettingPath(attributeDef)); } }
[ "public", "void", "removeDisplayerSetting", "(", "DisplayerAttributeGroupDef", "displayerAttributeGroup", ")", "{", "for", "(", "DisplayerAttributeDef", "attributeDef", ":", "displayerAttributeGroup", ".", "getChildren", "(", ")", ")", "{", "settings", ".", "remove", "(...
'Generic' remove method
[ "Generic", "remove", "method" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettings.java#L239-L243
train
dashbuilder/dashbuilder
dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleDisplayerView.java
GoogleDisplayerView.draw
@Override public void draw() { if (googleRenderer == null) { getPresenter().showError(new ClientRuntimeError("Google renderer not set")); } else if (!getPresenter().isDrawn()) { List<Displayer> displayerList = new ArrayList<Displayer>(); displayerList.ad...
java
@Override public void draw() { if (googleRenderer == null) { getPresenter().showError(new ClientRuntimeError("Google renderer not set")); } else if (!getPresenter().isDrawn()) { List<Displayer> displayerList = new ArrayList<Displayer>(); displayerList.ad...
[ "@", "Override", "public", "void", "draw", "(", ")", "{", "if", "(", "googleRenderer", "==", "null", ")", "{", "getPresenter", "(", ")", ".", "showError", "(", "new", "ClientRuntimeError", "(", "\"Google renderer not set\"", ")", ")", ";", "}", "else", "if...
GCharts drawing is performed asynchronously
[ "GCharts", "drawing", "is", "performed", "asynchronously" ]
50ef88210726b4f2f33f1a82eaf0f542e38dedd9
https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-google/src/main/java/org/dashbuilder/renderer/google/client/GoogleDisplayerView.java#L79-L89
train