id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
100,500
groupe-sii/ogham
ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/JavaMailBuilder.java
JavaMailBuilder.port
public JavaMailBuilder port(String... port) { for (String p : port) { if (p != null) { ports.add(p); } } return this; }
java
public JavaMailBuilder port(String... port) { for (String p : port) { if (p != null) { ports.add(p); } } return this; }
[ "public", "JavaMailBuilder", "port", "(", "String", "...", "port", ")", "{", "for", "(", "String", "p", ":", "port", ")", "{", "if", "(", "p", "!=", "null", ")", "{", "ports", ".", "add", "(", "p", ")", ";", "}", "}", "return", "this", ";", "}"...
Set the mail server port. You can specify a direct value. For example: <pre> .port("25"); </pre> <p> You can also specify one or several property keys. For example: <pre> .port("${custom.property.high-priority}", "${custom.property.low-priority}"); </pre> The properties are not immediately evaluated. The evaluatio...
[ "Set", "the", "mail", "server", "port", "." ]
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/JavaMailBuilder.java#L298-L305
100,501
groupe-sii/ogham
ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/JavaMailBuilder.java
JavaMailBuilder.charset
public JavaMailBuilder charset(String... charsets) { for (String c : charsets) { if (c != null) { this.charsets.add(c); } } return this; }
java
public JavaMailBuilder charset(String... charsets) { for (String c : charsets) { if (c != null) { this.charsets.add(c); } } return this; }
[ "public", "JavaMailBuilder", "charset", "(", "String", "...", "charsets", ")", "{", "for", "(", "String", "c", ":", "charsets", ")", "{", "if", "(", "c", "!=", "null", ")", "{", "this", ".", "charsets", ".", "add", "(", "c", ")", ";", "}", "}", "...
Set charset to use for email body. You can specify a direct value. For example: <pre> .charset("UTF-8"); </pre> <p> You can also specify one or several property keys. For example: <pre> .charset("${custom.property.high-priority}", "${custom.property.low-priority}"); </pre> The properties are not immediately evalua...
[ "Set", "charset", "to", "use", "for", "email", "body", "." ]
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/JavaMailBuilder.java#L335-L342
100,502
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner.java
JsoupCssInliner.internStyles
private void internStyles(Document doc, List<ExternalCss> cssContents) { Elements els = doc.select(CSS_LINKS_SELECTOR); for (Element e : els) { if (!TRUE_VALUE.equals(e.attr(SKIP_INLINE))) { String path = e.attr(HREF_ATTR); Element style = new Element(Tag.valueOf(STYLE_TAG), ""); style.appendChild(ne...
java
private void internStyles(Document doc, List<ExternalCss> cssContents) { Elements els = doc.select(CSS_LINKS_SELECTOR); for (Element e : els) { if (!TRUE_VALUE.equals(e.attr(SKIP_INLINE))) { String path = e.attr(HREF_ATTR); Element style = new Element(Tag.valueOf(STYLE_TAG), ""); style.appendChild(ne...
[ "private", "void", "internStyles", "(", "Document", "doc", ",", "List", "<", "ExternalCss", ">", "cssContents", ")", "{", "Elements", "els", "=", "doc", ".", "select", "(", "CSS_LINKS_SELECTOR", ")", ";", "for", "(", "Element", "e", ":", "els", ")", "{",...
Replace link tags with style tags in order to keep the same inclusion order @param doc the html document @param cssContents the list of external css files with their content
[ "Replace", "link", "tags", "with", "style", "tags", "in", "order", "to", "keep", "the", "same", "inclusion", "order" ]
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/html/inliner/impl/jsoup/JsoupCssInliner.java#L68-L78
100,503
groupe-sii/ogham
ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/util/HttpUtils.java
HttpUtils.convert
private static List<Parameter> convert(Map<String, Object> map) { Set<Entry<String, Object>> entries = map.entrySet(); List<Parameter> parameters = new ArrayList<>(entries.size()); for (Entry<String, Object> entry : entries) { if (entry.getValue() != null) { parameters.add(new Parameter(entry.getKey(), ent...
java
private static List<Parameter> convert(Map<String, Object> map) { Set<Entry<String, Object>> entries = map.entrySet(); List<Parameter> parameters = new ArrayList<>(entries.size()); for (Entry<String, Object> entry : entries) { if (entry.getValue() != null) { parameters.add(new Parameter(entry.getKey(), ent...
[ "private", "static", "List", "<", "Parameter", ">", "convert", "(", "Map", "<", "String", ",", "Object", ">", "map", ")", "{", "Set", "<", "Entry", "<", "String", ",", "Object", ">", ">", "entries", "=", "map", ".", "entrySet", "(", ")", ";", "List...
Convert the map into a list of parameters @param map the map to convert @return the list of parameters
[ "Convert", "the", "map", "into", "a", "list", "of", "parameters" ]
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/util/HttpUtils.java#L179-L188
100,504
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/core/template/context/SimpleContext.java
SimpleContext.addValue
public final SimpleContext addValue(String variable, Object value) { variables.put(variable, value); return this; }
java
public final SimpleContext addValue(String variable, Object value) { variables.put(variable, value); return this; }
[ "public", "final", "SimpleContext", "addValue", "(", "String", "variable", ",", "Object", "value", ")", "{", "variables", ".", "put", "(", "variable", ",", "value", ")", ";", "return", "this", ";", "}" ]
Add a new variable entry. @param variable the name of the variable @param value the value of the variable @return the context for fluent use
[ "Add", "a", "new", "variable", "entry", "." ]
e273b845604add74b5a25dfd931cb3c166b1008f
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/template/context/SimpleContext.java#L56-L59
100,505
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/util/SslUtils.java
SslUtils.ignoreSslIssues
public static void ignoreSslIssues(final HttpObjectConfig.Execution execution){ execution.setSslContext(acceptingSslContext()); execution.setHostnameVerifier(ANY_HOSTNAME); }
java
public static void ignoreSslIssues(final HttpObjectConfig.Execution execution){ execution.setSslContext(acceptingSslContext()); execution.setHostnameVerifier(ANY_HOSTNAME); }
[ "public", "static", "void", "ignoreSslIssues", "(", "final", "HttpObjectConfig", ".", "Execution", "execution", ")", "{", "execution", ".", "setSslContext", "(", "acceptingSslContext", "(", ")", ")", ";", "execution", ".", "setHostnameVerifier", "(", "ANY_HOSTNAME",...
Configuration helper used to ignore any SSL certificate-related issues by configuring an `SSLContext` that allows everything. [source,groovy] ---- def http = JavaHttpBuilder.configure { ignoreSslIssues(execution) } ---- This will inject the correct configuration to set the `sslContext` and `hostnameVerifier` - these ...
[ "Configuration", "helper", "used", "to", "ignore", "any", "SSL", "certificate", "-", "related", "issues", "by", "configuring", "an", "SSLContext", "that", "allows", "everything", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/util/SslUtils.java#L68-L71
100,506
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java
UriBuilder.setPath
public UriBuilder setPath(final String str) { final String[] parts; if (str.startsWith("/")) { parts = new String[]{str}; } else { final String base = getPath().toString(); parts = new String[]{base, base.endsWith("/") ? "" : "/", str}; } retu...
java
public UriBuilder setPath(final String str) { final String[] parts; if (str.startsWith("/")) { parts = new String[]{str}; } else { final String base = getPath().toString(); parts = new String[]{base, base.endsWith("/") ? "" : "/", str}; } retu...
[ "public", "UriBuilder", "setPath", "(", "final", "String", "str", ")", "{", "final", "String", "[", "]", "parts", ";", "if", "(", "str", ".", "startsWith", "(", "\"/\"", ")", ")", "{", "parts", "=", "new", "String", "[", "]", "{", "str", "}", ";", ...
Sets the path part of the URI. @param str the path part of the URI @return a reference to the builder
[ "Sets", "the", "path", "part", "of", "the", "URI", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java#L167-L177
100,507
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java
UriBuilder.toURI
public URI toURI() throws URISyntaxException { final String scheme = traverse(this, UriBuilder::getParent, UriBuilder::getScheme, Traverser::notNull); final Integer port = traverse(this, UriBuilder::getParent, UriBuilder::getPort, notValue(DEFAULT_PORT)); final String host = traverse(this, UriBu...
java
public URI toURI() throws URISyntaxException { final String scheme = traverse(this, UriBuilder::getParent, UriBuilder::getScheme, Traverser::notNull); final Integer port = traverse(this, UriBuilder::getParent, UriBuilder::getPort, notValue(DEFAULT_PORT)); final String host = traverse(this, UriBu...
[ "public", "URI", "toURI", "(", ")", "throws", "URISyntaxException", "{", "final", "String", "scheme", "=", "traverse", "(", "this", ",", "UriBuilder", "::", "getParent", ",", "UriBuilder", "::", "getScheme", ",", "Traverser", "::", "notNull", ")", ";", "fina...
Converts the parts of the `UriBuilder` to the `URI` object instance. @return the generated `URI` representing the parts contained in the builder
[ "Converts", "the", "parts", "of", "the", "UriBuilder", "to", "the", "URI", "object", "instance", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java#L196-L211
100,508
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java
UriBuilder.extractQueryMap
private static Map<String, Collection<String>> extractQueryMap(final String queryString) { final Map<String, Collection<String>> map = new HashMap<>(); for (final String nvp : queryString.split("&")) { final String[] pair = nvp.split("="); map.computeIfAbsent(pair[0], k -> { ...
java
private static Map<String, Collection<String>> extractQueryMap(final String queryString) { final Map<String, Collection<String>> map = new HashMap<>(); for (final String nvp : queryString.split("&")) { final String[] pair = nvp.split("="); map.computeIfAbsent(pair[0], k -> { ...
[ "private", "static", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "extractQueryMap", "(", "final", "String", "queryString", ")", "{", "final", "Map", "<", "String", ",", "Collection", "<", "String", ">", ">", "map", "=", "new", "Hash...
does not do any encoding
[ "does", "not", "do", "any", "encoding" ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/UriBuilder.java#L289-L302
100,509
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/MultipartContent.java
MultipartContent.part
public MultipartContent part(String fieldName, String value) { return part(fieldName, null, ContentTypes.TEXT.getAt(0), value); }
java
public MultipartContent part(String fieldName, String value) { return part(fieldName, null, ContentTypes.TEXT.getAt(0), value); }
[ "public", "MultipartContent", "part", "(", "String", "fieldName", ",", "String", "value", ")", "{", "return", "part", "(", "fieldName", ",", "null", ",", "ContentTypes", ".", "TEXT", ".", "getAt", "(", "0", ")", ",", "value", ")", ";", "}" ]
Configures a field part with the given field name and value. @param fieldName the field name @param value the value @return a reference to this {@link MultipartContent} instance
[ "Configures", "a", "field", "part", "with", "the", "given", "field", "name", "and", "value", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/MultipartContent.java#L102-L104
100,510
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.configure
public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, @DelegatesTo(HttpObjectConfig.class) final Closure closure) { HttpObjectConfig impl = new HttpObjectConfigImpl(); closure.setDelegate(impl); closure.setResolveStrategy(Closure.DELEGATE_FIRST); ...
java
public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, @DelegatesTo(HttpObjectConfig.class) final Closure closure) { HttpObjectConfig impl = new HttpObjectConfigImpl(); closure.setDelegate(impl); closure.setResolveStrategy(Closure.DELEGATE_FIRST); ...
[ "public", "static", "HttpBuilder", "configure", "(", "final", "Function", "<", "HttpObjectConfig", ",", "?", "extends", "HttpBuilder", ">", "factory", ",", "@", "DelegatesTo", "(", "HttpObjectConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", ...
Creates an `HttpBuilder` configured with the provided configuration closure, using the `defaultFactory` as the client factory. The configuration closure delegates to the {@link HttpObjectConfig} interface, which is an extension of the {@link HttpConfig} interface - configuration properties from either may be applied t...
[ "Creates", "an", "HttpBuilder", "configured", "with", "the", "provided", "configuration", "closure", "using", "the", "defaultFactory", "as", "the", "client", "factory", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L150-L156
100,511
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.configure
public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, final Consumer<HttpObjectConfig> configuration) { HttpObjectConfig impl = new HttpObjectConfigImpl(); configuration.accept(impl); return factory.apply(impl); }
java
public static HttpBuilder configure(final Function<HttpObjectConfig, ? extends HttpBuilder> factory, final Consumer<HttpObjectConfig> configuration) { HttpObjectConfig impl = new HttpObjectConfigImpl(); configuration.accept(impl); return factory.apply(impl); }
[ "public", "static", "HttpBuilder", "configure", "(", "final", "Function", "<", "HttpObjectConfig", ",", "?", "extends", "HttpBuilder", ">", "factory", ",", "final", "Consumer", "<", "HttpObjectConfig", ">", "configuration", ")", "{", "HttpObjectConfig", "impl", "=...
Creates an `HttpBuilder` using the provided client factory function, configured with the provided configuration function. The configuration {@link Consumer} function accepts an instance of the {@link HttpObjectConfig} interface, which is an extension of the {@link HttpConfig} interface - configuration properties from ...
[ "Creates", "an", "HttpBuilder", "using", "the", "provided", "client", "factory", "function", "configured", "with", "the", "provided", "configuration", "function", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L223-L227
100,512
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.get
public <T> T get(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.GET).apply(configureRequest(type, HttpVerb.GET, closure), this::doGet)); }
java
public <T> T get(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.GET).apply(configureRequest(type, HttpVerb.GET, closure), this::doGet)); }
[ "public", "<", "T", ">", "T", "get", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get",...
Executes a GET request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } String result = http.get(String){ request.uri.path = '/som...
[ "Executes", "a", "GET", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L345-L347
100,513
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.get
public <T> T get(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.GET).apply(configureRequest(type, HttpVerb.GET, configuration), this::doGet)); }
java
public <T> T get(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.GET).apply(configureRequest(type, HttpVerb.GET, configuration), this::doGet)); }
[ "public", "<", "T", ">", "T", "get", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "GET...
Executes a GET request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getReques...
[ "Executes", "a", "GET", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L371-L373
100,514
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.head
public <T> T head(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.HEAD).apply(configureRequest(type, HttpVerb.HEAD, configuration), this::doHead)); }
java
public <T> T head(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.HEAD).apply(configureRequest(type, HttpVerb.HEAD, configuration), this::doHead)); }
[ "public", "<", "T", ">", "T", "head", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "HE...
Executes a HEAD request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getReque...
[ "Executes", "a", "HEAD", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L560-L562
100,515
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.post
public <T> T post(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.POST).apply(configureRequest(type, HttpVerb.POST, closure), this::doPost)); }
java
public <T> T post(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.POST).apply(configureRequest(type, HttpVerb.POST, closure), this::doPost)); }
[ "public", "<", "T", ">", "T", "post", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get"...
Executes an POST request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } Date date = http.post(Date){ request.uri.path = '/date' ...
[ "Executes", "an", "POST", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L731-L733
100,516
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.post
public <T> T post(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.POST).apply(configureRequest(type, HttpVerb.POST, configuration), this::doPost)); }
java
public <T> T post(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.POST).apply(configureRequest(type, HttpVerb.POST, configuration), this::doPost)); }
[ "public", "<", "T", ">", "T", "post", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "PO...
Executes a POST request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getReque...
[ "Executes", "a", "POST", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L757-L759
100,517
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.put
public <T> T put(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.PUT).apply(configureRequest(type, HttpVerb.PUT, closure), this::doPut)); }
java
public <T> T put(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.PUT).apply(configureRequest(type, HttpVerb.PUT, closure), this::doPut)); }
[ "public", "<", "T", ">", "T", "put", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get",...
Executes an PUT request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } Date date = http.put(Date){ request.uri.path = '/date' re...
[ "Executes", "an", "PUT", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L929-L931
100,518
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.put
public <T> T put(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.PUT).apply(configureRequest(type, HttpVerb.PUT, configuration), this::doPut)); }
java
public <T> T put(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.PUT).apply(configureRequest(type, HttpVerb.PUT, configuration), this::doPut)); }
[ "public", "<", "T", ">", "T", "put", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "PUT...
Executes a PUT request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getReques...
[ "Executes", "a", "PUT", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L955-L957
100,519
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.delete
public <T> T delete(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.DELETE).apply(configureRequest(type, HttpVerb.DELETE, closure), this::doDelete)); }
java
public <T> T delete(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.DELETE).apply(configureRequest(type, HttpVerb.DELETE, closure), this::doDelete)); }
[ "public", "<", "T", ">", "T", "delete", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "ge...
Executes an DELETE request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } Date date = http.delete(Date){ request.uri.path = '/da...
[ "Executes", "an", "DELETE", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1125-L1127
100,520
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.delete
public <T> T delete(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.DELETE).apply(configureRequest(type, HttpVerb.DELETE, configuration), this::doDelete)); }
java
public <T> T delete(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.DELETE).apply(configureRequest(type, HttpVerb.DELETE, configuration), this::doDelete)); }
[ "public", "<", "T", ">", "T", "delete", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "...
Executes a DELETE request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getReq...
[ "Executes", "a", "DELETE", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1151-L1153
100,521
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.patch
public <T> T patch(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.PATCH).apply(configureRequest(type, HttpVerb.PATCH, closure), this::doPatch)); }
java
public <T> T patch(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.PATCH).apply(configureRequest(type, HttpVerb.PATCH, closure), this::doPatch)); }
[ "public", "<", "T", ">", "T", "patch", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get...
Executes a PATCH request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101' } String result = http.patch(String){ request.uri.path = '...
[ "Executes", "a", "PATCH", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1596-L1598
100,522
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.patch
public <T> T patch(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.PATCH).apply(configureRequest(type, HttpVerb.PATCH, configuration), this::doPatch)); }
java
public <T> T patch(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.PATCH).apply(configureRequest(type, HttpVerb.PATCH, configuration), this::doPatch)); }
[ "public", "<", "T", ">", "T", "patch", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "P...
Executes a PATCH request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getRequ...
[ "Executes", "a", "PATCH", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1622-L1624
100,523
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.options
public <T> T options(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.OPTIONS).apply(configureRequest(type, HttpVerb.OPTIONS, configuration), this::doOptions)); }
java
public <T> T options(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.OPTIONS).apply(configureRequest(type, HttpVerb.OPTIONS, configuration), this::doOptions)); }
[ "public", "<", "T", ">", "T", "options", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", ...
Executes a OPTIONS request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getRe...
[ "Executes", "a", "OPTIONS", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1857-L1859
100,524
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.trace
public <T> T trace(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.TRACE).apply(configureRequest(type, HttpVerb.TRACE, closure), this::doTrace)); }
java
public <T> T trace(final Class<T> type, @DelegatesTo(HttpConfig.class) final Closure closure) { return type.cast(interceptors.get(HttpVerb.TRACE).apply(configureRequest(type, HttpVerb.TRACE, closure), this::doTrace)); }
[ "public", "<", "T", ">", "T", "trace", "(", "final", "Class", "<", "T", ">", "type", ",", "@", "DelegatesTo", "(", "HttpConfig", ".", "class", ")", "final", "Closure", "closure", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get...
Executes a TRACE request on the configured URI, with additional configuration provided by the configuration closure. The result will be cast to the specified `type`. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = 'http://localhost:10101/date' } Date result = http.trace(Date){ response.success { ...
[ "Executes", "a", "TRACE", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "closure", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L2072-L2074
100,525
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java
HttpBuilder.trace
public <T> T trace(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.TRACE).apply(configureRequest(type, HttpVerb.TRACE, configuration), this::doTrace)); }
java
public <T> T trace(final Class<T> type, final Consumer<HttpConfig> configuration) { return type.cast(interceptors.get(HttpVerb.TRACE).apply(configureRequest(type, HttpVerb.TRACE, configuration), this::doTrace)); }
[ "public", "<", "T", ">", "T", "trace", "(", "final", "Class", "<", "T", ">", "type", ",", "final", "Consumer", "<", "HttpConfig", ">", "configuration", ")", "{", "return", "type", ".", "cast", "(", "interceptors", ".", "get", "(", "HttpVerb", ".", "T...
Executes a TRACE request on the configured URI, with additional configuration provided by the configuration function. The result will be cast to the specified `type`. This method is generally used for Java-specific configuration. [source,groovy] ---- HttpBuilder http = HttpBuilder.configure(config -> { config.getRequ...
[ "Executes", "a", "TRACE", "request", "on", "the", "configured", "URI", "with", "additional", "configuration", "provided", "by", "the", "configuration", "function", ".", "The", "result", "will", "be", "cast", "to", "the", "specified", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L2098-L2100
100,526
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/NonBlockingCookieStore.java
NonBlockingCookieStore.add
public void add(final URI uri, final HttpCookie cookie) { if(cookie.getMaxAge() == 0) { return; } if(cookie.getDomain() != null) { add(new DomainKey(cookie), cookie); } if(uri != null) { add(new UriKey(uri, cookie), cookie); }...
java
public void add(final URI uri, final HttpCookie cookie) { if(cookie.getMaxAge() == 0) { return; } if(cookie.getDomain() != null) { add(new DomainKey(cookie), cookie); } if(uri != null) { add(new UriKey(uri, cookie), cookie); }...
[ "public", "void", "add", "(", "final", "URI", "uri", ",", "final", "HttpCookie", "cookie", ")", "{", "if", "(", "cookie", ".", "getMaxAge", "(", ")", "==", "0", ")", "{", "return", ";", "}", "if", "(", "cookie", ".", "getDomain", "(", ")", "!=", ...
public cookie store api
[ "public", "cookie", "store", "api" ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/NonBlockingCookieStore.java#L37-L49
100,527
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/NonBlockingCookieStore.java
NonBlockingCookieStore.netscapeDomainMatches
private boolean netscapeDomainMatches(final String domain, final String host) { if (domain == null || host == null) { return false; } // if there's no embedded dot in domain and domain is not .local boolean isLocalDomain = ".local".equalsIgnoreCase(domain); int embed...
java
private boolean netscapeDomainMatches(final String domain, final String host) { if (domain == null || host == null) { return false; } // if there's no embedded dot in domain and domain is not .local boolean isLocalDomain = ".local".equalsIgnoreCase(domain); int embed...
[ "private", "boolean", "netscapeDomainMatches", "(", "final", "String", "domain", ",", "final", "String", "host", ")", "{", "if", "(", "domain", "==", "null", "||", "host", "==", "null", ")", "{", "return", "false", ";", "}", "// if there's no embedded dot in d...
shamelessly copied from jdk8 source code for InMemoryCookieStore
[ "shamelessly", "copied", "from", "jdk8", "source", "code", "for", "InMemoryCookieStore" ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/NonBlockingCookieStore.java#L259-L300
100,528
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java
Csv.parse
public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final Csv.Context ctx = (Csv.Context) config.actualContext(fromServer.getContentType(), Csv.Context.ID); return ctx.makeReader(fromServer.getReader()).readAll(); } catch (IOException e...
java
public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final Csv.Context ctx = (Csv.Context) config.actualContext(fromServer.getContentType(), Csv.Context.ID); return ctx.makeReader(fromServer.getReader()).readAll(); } catch (IOException e...
[ "public", "static", "Object", "parse", "(", "final", "ChainedHttpConfig", "config", ",", "final", "FromServer", "fromServer", ")", "{", "try", "{", "final", "Csv", ".", "Context", "ctx", "=", "(", "Csv", ".", "Context", ")", "config", ".", "actualContext", ...
Used to parse the server response content using the OpenCsv parser. @param config the configuration @param fromServer the server content accessor @return the parsed object
[ "Used", "to", "parse", "the", "server", "response", "content", "using", "the", "OpenCsv", "parser", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java#L99-L106
100,529
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java
Csv.encode
public static void encode(final ChainedHttpConfig config, final ToServer ts) { if (handleRawUpload(config, ts)) { return; } final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest(); final Csv.Context ctx = (Csv.Context) config.actualContext(request.actualC...
java
public static void encode(final ChainedHttpConfig config, final ToServer ts) { if (handleRawUpload(config, ts)) { return; } final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest(); final Csv.Context ctx = (Csv.Context) config.actualContext(request.actualC...
[ "public", "static", "void", "encode", "(", "final", "ChainedHttpConfig", "config", ",", "final", "ToServer", "ts", ")", "{", "if", "(", "handleRawUpload", "(", "config", ",", "ts", ")", ")", "{", "return", ";", "}", "final", "ChainedHttpConfig", ".", "Chai...
Used to encode the request content using the OpenCsv writer. @param config the configuration @param ts the server request content accessor
[ "Used", "to", "encode", "the", "request", "content", "using", "the", "OpenCsv", "writer", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Csv.java#L114-L132
100,530
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/FileBackedCookieStore.java
FileBackedCookieStore.readAll
private void readAll() { final List<CompletableFuture<Void>> futures = new ArrayList<>(); for(File file : directory.listFiles()) { final Runnable loadFile = () -> { if(file.getName().endsWith(SUFFIX)) { try(FileReader reader = new FileReader(f...
java
private void readAll() { final List<CompletableFuture<Void>> futures = new ArrayList<>(); for(File file : directory.listFiles()) { final Runnable loadFile = () -> { if(file.getName().endsWith(SUFFIX)) { try(FileReader reader = new FileReader(f...
[ "private", "void", "readAll", "(", ")", "{", "final", "List", "<", "CompletableFuture", "<", "Void", ">", ">", "futures", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "File", "file", ":", "directory", ".", "listFiles", "(", ")", ")", "{"...
each cookie store controls its own directory, we do not need to synchronize
[ "each", "cookie", "store", "controls", "its", "own", "directory", "we", "do", "not", "need", "to", "synchronize" ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/FileBackedCookieStore.java#L169-L200
100,531
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java
Jackson.parse
@SuppressWarnings("WeakerAccess") public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final ObjectMapper mapper = (ObjectMapper) config.actualContext(fromServer.getContentType(), OBJECT_MAPPER_ID); return mapper.readValue(fromServer.getRead...
java
@SuppressWarnings("WeakerAccess") public static Object parse(final ChainedHttpConfig config, final FromServer fromServer) { try { final ObjectMapper mapper = (ObjectMapper) config.actualContext(fromServer.getContentType(), OBJECT_MAPPER_ID); return mapper.readValue(fromServer.getRead...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "static", "Object", "parse", "(", "final", "ChainedHttpConfig", "config", ",", "final", "FromServer", "fromServer", ")", "{", "try", "{", "final", "ObjectMapper", "mapper", "=", "(", "ObjectMapper", ...
Used to parse the server response content using the Jackson JSON parser. @param config the configuration @param fromServer the server content accessor @return the parsed object
[ "Used", "to", "parse", "the", "server", "response", "content", "using", "the", "Jackson", "JSON", "parser", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java#L40-L48
100,532
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java
Jackson.encode
@SuppressWarnings("WeakerAccess") public static void encode(final ChainedHttpConfig config, final ToServer ts) { try { if (handleRawUpload(config, ts)) { return; } final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest(); fi...
java
@SuppressWarnings("WeakerAccess") public static void encode(final ChainedHttpConfig config, final ToServer ts) { try { if (handleRawUpload(config, ts)) { return; } final ChainedHttpConfig.ChainedRequest request = config.getChainedRequest(); fi...
[ "@", "SuppressWarnings", "(", "\"WeakerAccess\"", ")", "public", "static", "void", "encode", "(", "final", "ChainedHttpConfig", "config", ",", "final", "ToServer", "ts", ")", "{", "try", "{", "if", "(", "handleRawUpload", "(", "config", ",", "ts", ")", ")", ...
Used to encode the request content using the Jackson JSON encoder. @param config the configuration @param ts the server request content accessor
[ "Used", "to", "encode", "the", "request", "content", "using", "the", "Jackson", "JSON", "encoder", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java#L56-L71
100,533
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java
Jackson.mapper
public static void mapper(final HttpConfig config, final ObjectMapper mapper) { mapper(config, mapper, ContentTypes.JSON); }
java
public static void mapper(final HttpConfig config, final ObjectMapper mapper) { mapper(config, mapper, ContentTypes.JSON); }
[ "public", "static", "void", "mapper", "(", "final", "HttpConfig", "config", ",", "final", "ObjectMapper", "mapper", ")", "{", "mapper", "(", "config", ",", "mapper", ",", "ContentTypes", ".", "JSON", ")", ";", "}" ]
Used to configure the provided Jackson `ObjectMapper` in the configuration context for the default JSON content type. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = "${serverRule.serverUrl}/jackson" request.contentType = JSON[0] Jackson.mapper(delegate, objectMapper) } ---- @param config the co...
[ "Used", "to", "configure", "the", "provided", "Jackson", "ObjectMapper", "in", "the", "configuration", "context", "for", "the", "default", "JSON", "content", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java#L88-L90
100,534
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java
Jackson.mapper
public static void mapper(final HttpConfig config, final ObjectMapper mapper, final Iterable<String> contentTypes) { config.context(contentTypes, OBJECT_MAPPER_ID, mapper); }
java
public static void mapper(final HttpConfig config, final ObjectMapper mapper, final Iterable<String> contentTypes) { config.context(contentTypes, OBJECT_MAPPER_ID, mapper); }
[ "public", "static", "void", "mapper", "(", "final", "HttpConfig", "config", ",", "final", "ObjectMapper", "mapper", ",", "final", "Iterable", "<", "String", ">", "contentTypes", ")", "{", "config", ".", "context", "(", "contentTypes", ",", "OBJECT_MAPPER_ID", ...
Used to configure the provided Jackson `ObjectMapper` in the configuration context for the specified content type. [source,groovy] ---- def http = HttpBuilder.configure { request.uri = "${serverRule.serverUrl}/jackson" request.contentType = OTHER_TYPE Jackson.mapper(delegate, objectMapper, [OTHER_TYPE]) } ---- @param...
[ "Used", "to", "configure", "the", "provided", "Jackson", "ObjectMapper", "in", "the", "configuration", "context", "for", "the", "specified", "content", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Jackson.java#L108-L110
100,535
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java
Download.toFile
public static void toFile(final HttpConfig config, final File file) { toFile(config, ContentTypes.ANY.getAt(0), file); }
java
public static void toFile(final HttpConfig config, final File file) { toFile(config, ContentTypes.ANY.getAt(0), file); }
[ "public", "static", "void", "toFile", "(", "final", "HttpConfig", "config", ",", "final", "File", "file", ")", "{", "toFile", "(", "config", ",", "ContentTypes", ".", "ANY", ".", "getAt", "(", "0", ")", ",", "file", ")", ";", "}" ]
Downloads the content to a specified file. @param config the `HttpConfig` instance @param file the file where content will be downloaded
[ "Downloads", "the", "content", "to", "a", "specified", "file", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L81-L83
100,536
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java
Download.toFile
public static void toFile(final HttpConfig config, final String contentType, final File file) { config.context(contentType, ID, file); config.getResponse().parser(contentType, Download::fileParser); }
java
public static void toFile(final HttpConfig config, final String contentType, final File file) { config.context(contentType, ID, file); config.getResponse().parser(contentType, Download::fileParser); }
[ "public", "static", "void", "toFile", "(", "final", "HttpConfig", "config", ",", "final", "String", "contentType", ",", "final", "File", "file", ")", "{", "config", ".", "context", "(", "contentType", ",", "ID", ",", "file", ")", ";", "config", ".", "get...
Downloads the content to a specified file with the specified content type. @param config the `HttpConfig` instance @param file the file where content will be downloaded @param contentType the content type
[ "Downloads", "the", "content", "to", "a", "specified", "file", "with", "the", "specified", "content", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L92-L95
100,537
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java
Download.toStream
public static void toStream(final HttpConfig config, final OutputStream ostream) { toStream(config, ContentTypes.ANY.getAt(0), ostream); }
java
public static void toStream(final HttpConfig config, final OutputStream ostream) { toStream(config, ContentTypes.ANY.getAt(0), ostream); }
[ "public", "static", "void", "toStream", "(", "final", "HttpConfig", "config", ",", "final", "OutputStream", "ostream", ")", "{", "toStream", "(", "config", ",", "ContentTypes", ".", "ANY", ".", "getAt", "(", "0", ")", ",", "ostream", ")", ";", "}" ]
Downloads the content into an `OutputStream`. @param config the `HttpConfig` instance @param ostream the `OutputStream` to contain the content.
[ "Downloads", "the", "content", "into", "an", "OutputStream", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L103-L105
100,538
http-builder-ng/http-builder-ng
http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java
Download.toStream
public static void toStream(final HttpConfig config, final String contentType, final OutputStream ostream) { config.context(contentType, ID, ostream); config.getResponse().parser(contentType, Download::streamParser); }
java
public static void toStream(final HttpConfig config, final String contentType, final OutputStream ostream) { config.context(contentType, ID, ostream); config.getResponse().parser(contentType, Download::streamParser); }
[ "public", "static", "void", "toStream", "(", "final", "HttpConfig", "config", ",", "final", "String", "contentType", ",", "final", "OutputStream", "ostream", ")", "{", "config", ".", "context", "(", "contentType", ",", "ID", ",", "ostream", ")", ";", "config...
Downloads the content into an `OutputStream` with the specified content type. @param config the `HttpConfig` instance @param ostream the `OutputStream` to contain the content. @param contentType the content type
[ "Downloads", "the", "content", "into", "an", "OutputStream", "with", "the", "specified", "content", "type", "." ]
865f37732c102c748d3db8b905199dac9222a525
https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L114-L117
100,539
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.title
public Page title(String title) { properties.put(Title,title); String heading = (String)properties.get(Heading); if (heading==null||heading.equals(NoTitle)) properties.put(Heading,title); return this; }
java
public Page title(String title) { properties.put(Title,title); String heading = (String)properties.get(Heading); if (heading==null||heading.equals(NoTitle)) properties.put(Heading,title); return this; }
[ "public", "Page", "title", "(", "String", "title", ")", "{", "properties", ".", "put", "(", "Title", ",", "title", ")", ";", "String", "heading", "=", "(", "String", ")", "properties", ".", "get", "(", "Heading", ")", ";", "if", "(", "heading", "==",...
Set page title. @return This Page (for chained commands)
[ "Set", "page", "title", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L117-L124
100,540
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.setBackGroundColor
public final Page setBackGroundColor(String color) { properties.put(BgColour,color); attribute("bgcolor",color); return this; }
java
public final Page setBackGroundColor(String color) { properties.put(BgColour,color); attribute("bgcolor",color); return this; }
[ "public", "final", "Page", "setBackGroundColor", "(", "String", "color", ")", "{", "properties", ".", "put", "(", "BgColour", ",", "color", ")", ";", "attribute", "(", "\"bgcolor\"", ",", "color", ")", ";", "return", "this", ";", "}" ]
Set page background color. @return This Page (for chained commands)
[ "Set", "page", "background", "color", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L153-L158
100,541
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.setBase
public final Page setBase(String target, String href) { base="<base " + ((target!=null)?("TARGET=\""+target+"\""):"") + ((href!=null)?("HREF=\""+href+"\""):"") + ">"; return this; }
java
public final Page setBase(String target, String href) { base="<base " + ((target!=null)?("TARGET=\""+target+"\""):"") + ((href!=null)?("HREF=\""+href+"\""):"") + ">"; return this; }
[ "public", "final", "Page", "setBase", "(", "String", "target", ",", "String", "href", ")", "{", "base", "=", "\"<base \"", "+", "(", "(", "target", "!=", "null", ")", "?", "(", "\"TARGET=\\\"\"", "+", "target", "+", "\"\\\"\"", ")", ":", "\"\"", ")", ...
Set the URL Base for the Page. @param target Default link target, null if none. @param href Default absolute href, null if none. @return This Page (for chained commands)
[ "Set", "the", "URL", "Base", "for", "the", "Page", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L166-L173
100,542
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.writeBodyTag
public void writeBodyTag(Writer out) throws IOException { if (!writtenBodyTag) { writtenBodyTag = true; out.write("<body "+attributes()+">\n"); } }
java
public void writeBodyTag(Writer out) throws IOException { if (!writtenBodyTag) { writtenBodyTag = true; out.write("<body "+attributes()+">\n"); } }
[ "public", "void", "writeBodyTag", "(", "Writer", "out", ")", "throws", "IOException", "{", "if", "(", "!", "writtenBodyTag", ")", "{", "writtenBodyTag", "=", "true", ";", "out", ".", "write", "(", "\"<body \"", "+", "attributes", "(", ")", "+", "\">\\n\"",...
Write HTML page body tag. Write tags &ltBODY page attributes&gt.
[ "Write", "HTML", "page", "body", "tag", ".", "Write", "tags", "&ltBODY", "page", "attributes&gt", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L216-L224
100,543
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.write
public void write(Writer out, String section, boolean endHtml) throws IOException { writeHtmlHead(out); writeBodyTag(out); Composite s = getSection(section); if (s==null) { if (section.equals(Content)) ...
java
public void write(Writer out, String section, boolean endHtml) throws IOException { writeHtmlHead(out); writeBodyTag(out); Composite s = getSection(section); if (s==null) { if (section.equals(Content)) ...
[ "public", "void", "write", "(", "Writer", "out", ",", "String", "section", ",", "boolean", "endHtml", ")", "throws", "IOException", "{", "writeHtmlHead", "(", "out", ")", ";", "writeBodyTag", "(", "out", ")", ";", "Composite", "s", "=", "getSection", "(", ...
Write page section. The page is written containing only the named section. If a head and bodyTag have not been written, then they are written before the section. If endHtml is true, the end HTML tag is also written. If the named section is Content and it cannot be found, then the normal page contents are written.
[ "Write", "page", "section", ".", "The", "page", "is", "written", "containing", "only", "the", "named", "section", ".", "If", "a", "head", "and", "bodyTag", "have", "not", "been", "written", "then", "they", "are", "written", "before", "the", "section", ".",...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L254-L272
100,544
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.addSection
public void addSection(String section, Composite composite) { sections.put(section,composite); add(composite); }
java
public void addSection(String section, Composite composite) { sections.put(section,composite); add(composite); }
[ "public", "void", "addSection", "(", "String", "section", ",", "Composite", "composite", ")", "{", "sections", ".", "put", "(", "section", ",", "composite", ")", ";", "add", "(", "composite", ")", ";", "}" ]
Set a composite as a named section and add it to the. contents of the page
[ "Set", "a", "composite", "as", "a", "named", "section", "and", "add", "it", "to", "the", ".", "contents", "of", "the", "page" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L331-L335
100,545
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/html/Page.java
Page.addTo
public void addTo(String section, Object element) { Composite s = (Composite)sections.get(section); if (s==null) add(element); else s.add(element); }
java
public void addTo(String section, Object element) { Composite s = (Composite)sections.get(section); if (s==null) add(element); else s.add(element); }
[ "public", "void", "addTo", "(", "String", "section", ",", "Object", "element", ")", "{", "Composite", "s", "=", "(", "Composite", ")", "sections", ".", "get", "(", "section", ")", ";", "if", "(", "s", "==", "null", ")", "add", "(", "element", ")", ...
Add content to a named sections. If the named section cannot. be found, the content is added to the page.
[ "Add", "content", "to", "a", "named", "sections", ".", "If", "the", "named", "section", "cannot", ".", "be", "found", "the", "content", "is", "added", "to", "the", "page", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L349-L356
100,546
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.close
public void close() throws IOException { try{ _completing=true; if (_connection instanceof Socket && !(_connection instanceof SSLSocket)) ((Socket)_connection).shutdownOutput(); _outputStream.close(); _inputStream.close(); } ...
java
public void close() throws IOException { try{ _completing=true; if (_connection instanceof Socket && !(_connection instanceof SSLSocket)) ((Socket)_connection).shutdownOutput(); _outputStream.close(); _inputStream.close(); } ...
[ "public", "void", "close", "(", ")", "throws", "IOException", "{", "try", "{", "_completing", "=", "true", ";", "if", "(", "_connection", "instanceof", "Socket", "&&", "!", "(", "_connection", "instanceof", "SSLSocket", ")", ")", "(", "(", "Socket", ")", ...
Close the connection. This method calls close on the input and output streams and interrupts any thread in the handle method. may be specialized to close sockets etc. @exception IOException
[ "Close", "the", "connection", ".", "This", "method", "calls", "close", "on", "the", "input", "and", "output", "streams", "and", "interrupts", "any", "thread", "in", "the", "handle", "method", ".", "may", "be", "specialized", "to", "close", "sockets", "etc", ...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L259-L274
100,547
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.getServerName
public String getServerName() { String host=_listener.getHost(); if (InetAddrPort.__0_0_0_0.equals(host) && _connection instanceof Socket) host = ((Socket)_connection).getLocalAddress().getHostName(); return host; }
java
public String getServerName() { String host=_listener.getHost(); if (InetAddrPort.__0_0_0_0.equals(host) && _connection instanceof Socket) host = ((Socket)_connection).getLocalAddress().getHostName(); return host; }
[ "public", "String", "getServerName", "(", ")", "{", "String", "host", "=", "_listener", ".", "getHost", "(", ")", ";", "if", "(", "InetAddrPort", ".", "__0_0_0_0", ".", "equals", "(", "host", ")", "&&", "_connection", "instanceof", "Socket", ")", "host", ...
Get the listeners HttpServer. But if the name is 0.0.0.0, then the real interface address is used. @return HttpServer.
[ "Get", "the", "listeners", "HttpServer", ".", "But", "if", "the", "name", "is", "0", ".", "0", ".", "0", ".", "0", "then", "the", "real", "interface", "address", "is", "used", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L310-L318
100,548
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.getServerAddr
public String getServerAddr() { if (_connection instanceof Socket) return ((Socket)_connection).getLocalAddress().getHostAddress(); return _listener.getHost(); }
java
public String getServerAddr() { if (_connection instanceof Socket) return ((Socket)_connection).getLocalAddress().getHostAddress(); return _listener.getHost(); }
[ "public", "String", "getServerAddr", "(", ")", "{", "if", "(", "_connection", "instanceof", "Socket", ")", "return", "(", "(", "Socket", ")", "_connection", ")", ".", "getLocalAddress", "(", ")", ".", "getHostAddress", "(", ")", ";", "return", "_listener", ...
Get the listeners HttpServer. @return HttpServer.
[ "Get", "the", "listeners", "HttpServer", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L324-L329
100,549
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.firstWrite
protected void firstWrite() throws IOException { if (_response.isCommitted()) return; // Nobble the OutputStream for HEAD requests if (HttpRequest.__HEAD.equals(_request.getMethod())) _outputStream.nullOutput(); int length=_re...
java
protected void firstWrite() throws IOException { if (_response.isCommitted()) return; // Nobble the OutputStream for HEAD requests if (HttpRequest.__HEAD.equals(_request.getMethod())) _outputStream.nullOutput(); int length=_re...
[ "protected", "void", "firstWrite", "(", ")", "throws", "IOException", "{", "if", "(", "_response", ".", "isCommitted", "(", ")", ")", "return", ";", "// Nobble the OutputStream for HEAD requests", "if", "(", "HttpRequest", ".", "__HEAD", ".", "equals", "(", "_re...
Setup the reponse output stream. Use the current state of the request and response, to set tranfer parameters such as chunking and content length.
[ "Setup", "the", "reponse", "output", "stream", ".", "Use", "the", "current", "state", "of", "the", "request", "and", "response", "to", "set", "tranfer", "parameters", "such", "as", "chunking", "and", "content", "length", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L580-L593
100,550
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.service
protected HttpContext service(HttpRequest request, HttpResponse response) throws HttpException, IOException { if (_httpServer==null) throw new HttpException(HttpResponse.__503_Service_Unavailable); return _httpServer.service(request,response); }
java
protected HttpContext service(HttpRequest request, HttpResponse response) throws HttpException, IOException { if (_httpServer==null) throw new HttpException(HttpResponse.__503_Service_Unavailable); return _httpServer.service(request,response); }
[ "protected", "HttpContext", "service", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "HttpException", ",", "IOException", "{", "if", "(", "_httpServer", "==", "null", ")", "throw", "new", "HttpException", "(", "HttpResponse", ".", ...
Service a Request. This implementation passes the request and response to the service method of the HttpServer for this connections listener. If no HttpServer has been associated, the 503 is returned. This method may be specialized to implement other ways of servicing a request. @param request The request @param respon...
[ "Service", "a", "Request", ".", "This", "implementation", "passes", "the", "request", "and", "response", "to", "the", "service", "method", "of", "the", "HttpServer", "for", "this", "connections", "listener", ".", "If", "no", "HttpServer", "has", "been", "assoc...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L810-L816
100,551
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.recycle
protected void recycle() { _listener.persistConnection(this); if (_request!=null) _request.recycle(this); if (_response!=null) _response.recycle(this); }
java
protected void recycle() { _listener.persistConnection(this); if (_request!=null) _request.recycle(this); if (_response!=null) _response.recycle(this); }
[ "protected", "void", "recycle", "(", ")", "{", "_listener", ".", "persistConnection", "(", "this", ")", ";", "if", "(", "_request", "!=", "null", ")", "_request", ".", "recycle", "(", "this", ")", ";", "if", "(", "_response", "!=", "null", ")", "_respo...
Recycle the connection. called by handle when handleNext returns true.
[ "Recycle", "the", "connection", ".", "called", "by", "handle", "when", "handleNext", "returns", "true", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L1128-L1135
100,552
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java
HttpConnection.destroy
protected void destroy() { try{close();} catch (IOException e){LogSupport.ignore(log,e);} catch (Exception e){log.warn(LogSupport.EXCEPTION,e);} // Destroy request and response if (_request!=null) _request.destroy(); if (_response!=null) ...
java
protected void destroy() { try{close();} catch (IOException e){LogSupport.ignore(log,e);} catch (Exception e){log.warn(LogSupport.EXCEPTION,e);} // Destroy request and response if (_request!=null) _request.destroy(); if (_response!=null) ...
[ "protected", "void", "destroy", "(", ")", "{", "try", "{", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "LogSupport", ".", "ignore", "(", "log", ",", "e", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "log",...
Destroy the connection. called by handle when handleNext returns false.
[ "Destroy", "the", "connection", ".", "called", "by", "handle", "when", "handleNext", "returns", "false", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/HttpConnection.java#L1141-L1169
100,553
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Default.java
Default.getResource
protected Resource getResource(String pathInContext) throws IOException { Resource r = (_resourceBase == null) ? _httpContext.getResource(pathInContext) : _resourceBase.addPath(pathInContext); if (log.isDebugEnabled()) log.debug("RESOURCE=" + r); return r; }
java
protected Resource getResource(String pathInContext) throws IOException { Resource r = (_resourceBase == null) ? _httpContext.getResource(pathInContext) : _resourceBase.addPath(pathInContext); if (log.isDebugEnabled()) log.debug("RESOURCE=" + r); return r; }
[ "protected", "Resource", "getResource", "(", "String", "pathInContext", ")", "throws", "IOException", "{", "Resource", "r", "=", "(", "_resourceBase", "==", "null", ")", "?", "_httpContext", ".", "getResource", "(", "pathInContext", ")", ":", "_resourceBase", "....
get Resource to serve. Map a path to a resource. The default implementation calls HttpContext.getResource but derived servlets may provide their own mapping. @param pathInContext The path to find a resource for. @return The resource to serve.
[ "get", "Resource", "to", "serve", ".", "Map", "a", "path", "to", "a", "resource", ".", "The", "default", "implementation", "calls", "HttpContext", ".", "getResource", "but", "derived", "servlets", "may", "provide", "their", "own", "mapping", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Default.java#L165-L172
100,554
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Dispatcher.java
Dispatcher.type
public static int type(String type) { if ("request".equalsIgnoreCase(type)) return __REQUEST; if ("forward".equalsIgnoreCase(type)) return __FORWARD; if ("include".equalsIgnoreCase(type)) return __INCLUDE; if ("error".equalsIgnoreCase(type)) ...
java
public static int type(String type) { if ("request".equalsIgnoreCase(type)) return __REQUEST; if ("forward".equalsIgnoreCase(type)) return __FORWARD; if ("include".equalsIgnoreCase(type)) return __INCLUDE; if ("error".equalsIgnoreCase(type)) ...
[ "public", "static", "int", "type", "(", "String", "type", ")", "{", "if", "(", "\"request\"", ".", "equalsIgnoreCase", "(", "type", ")", ")", "return", "__REQUEST", ";", "if", "(", "\"forward\"", ".", "equalsIgnoreCase", "(", "type", ")", ")", "return", ...
Dispatch type from name
[ "Dispatch", "type", "from", "name" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/Dispatcher.java#L296-L307
100,555
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.getProxyHostsWhiteList
public String[] getProxyHostsWhiteList() { if (_proxyHostsWhiteList == null || _proxyHostsWhiteList.size() == 0) return new String[0]; String[] hosts = new String[_proxyHostsWhiteList.size()]; hosts = (String[]) _proxyHostsWhiteList.toArray(hosts); return hosts; }
java
public String[] getProxyHostsWhiteList() { if (_proxyHostsWhiteList == null || _proxyHostsWhiteList.size() == 0) return new String[0]; String[] hosts = new String[_proxyHostsWhiteList.size()]; hosts = (String[]) _proxyHostsWhiteList.toArray(hosts); return hosts; }
[ "public", "String", "[", "]", "getProxyHostsWhiteList", "(", ")", "{", "if", "(", "_proxyHostsWhiteList", "==", "null", "||", "_proxyHostsWhiteList", ".", "size", "(", ")", "==", "0", ")", "return", "new", "String", "[", "0", "]", ";", "String", "[", "]"...
Get proxy host white list. @return Array of hostnames and IPs that are proxied, or an empty array if all hosts are proxied.
[ "Get", "proxy", "host", "white", "list", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L129-L137
100,556
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.setProxyHostsWhiteList
public void setProxyHostsWhiteList(String[] hosts) { if (hosts == null || hosts.length == 0) _proxyHostsWhiteList = null; else { _proxyHostsWhiteList = new HashSet(); for (int i = 0; i < hosts.length; i++) if (hosts[i] != null && hosts[i].t...
java
public void setProxyHostsWhiteList(String[] hosts) { if (hosts == null || hosts.length == 0) _proxyHostsWhiteList = null; else { _proxyHostsWhiteList = new HashSet(); for (int i = 0; i < hosts.length; i++) if (hosts[i] != null && hosts[i].t...
[ "public", "void", "setProxyHostsWhiteList", "(", "String", "[", "]", "hosts", ")", "{", "if", "(", "hosts", "==", "null", "||", "hosts", ".", "length", "==", "0", ")", "_proxyHostsWhiteList", "=", "null", ";", "else", "{", "_proxyHostsWhiteList", "=", "new...
Set proxy host white list. @param hosts Array of hostnames and IPs that are proxied, or null if all hosts are proxied.
[ "Set", "proxy", "host", "white", "list", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L145-L156
100,557
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.getProxyHostsBlackList
public String[] getProxyHostsBlackList() { if (_proxyHostsBlackList == null || _proxyHostsBlackList.size() == 0) return new String[0]; String[] hosts = new String[_proxyHostsBlackList.size()]; hosts = (String[]) _proxyHostsBlackList.toArray(hosts); return hosts; }
java
public String[] getProxyHostsBlackList() { if (_proxyHostsBlackList == null || _proxyHostsBlackList.size() == 0) return new String[0]; String[] hosts = new String[_proxyHostsBlackList.size()]; hosts = (String[]) _proxyHostsBlackList.toArray(hosts); return hosts; }
[ "public", "String", "[", "]", "getProxyHostsBlackList", "(", ")", "{", "if", "(", "_proxyHostsBlackList", "==", "null", "||", "_proxyHostsBlackList", ".", "size", "(", ")", "==", "0", ")", "return", "new", "String", "[", "0", "]", ";", "String", "[", "]"...
Get proxy host black list. @return Array of hostnames and IPs that are NOT proxied.
[ "Get", "proxy", "host", "black", "list", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L164-L172
100,558
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.setProxyHostsBlackList
public void setProxyHostsBlackList(String[] hosts) { if (hosts == null || hosts.length == 0) _proxyHostsBlackList = null; else { _proxyHostsBlackList = new HashSet(); for (int i = 0; i < hosts.length; i++) if (hosts[i] != null && hosts[i].t...
java
public void setProxyHostsBlackList(String[] hosts) { if (hosts == null || hosts.length == 0) _proxyHostsBlackList = null; else { _proxyHostsBlackList = new HashSet(); for (int i = 0; i < hosts.length; i++) if (hosts[i] != null && hosts[i].t...
[ "public", "void", "setProxyHostsBlackList", "(", "String", "[", "]", "hosts", ")", "{", "if", "(", "hosts", "==", "null", "||", "hosts", ".", "length", "==", "0", ")", "_proxyHostsBlackList", "=", "null", ";", "else", "{", "_proxyHostsBlackList", "=", "new...
Set proxy host black list. @param hosts Array of hostnames and IPs that are NOT proxied.
[ "Set", "proxy", "host", "black", "list", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L180-L191
100,559
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.customizeConnection
protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, Socket socket) throws IOException { }
java
protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, Socket socket) throws IOException { }
[ "protected", "void", "customizeConnection", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "Socket", "socket", ")", "throws", "IOException", "{", "}" ]
Customize proxy Socket connection for CONNECT. Method to allow derived handlers to customize the tunnel sockets.
[ "Customize", "proxy", "Socket", "connection", "for", "CONNECT", ".", "Method", "to", "allow", "derived", "handlers", "to", "customize", "the", "tunnel", "sockets", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L531-L533
100,560
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.customizeConnection
protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, URLConnection connection) throws IOException { }
java
protected void customizeConnection(String pathInContext, String pathParams, HttpRequest request, URLConnection connection) throws IOException { }
[ "protected", "void", "customizeConnection", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "URLConnection", "connection", ")", "throws", "IOException", "{", "}" ]
Customize proxy URL connection. Method to allow derived handlers to customize the connection.
[ "Customize", "proxy", "URL", "connection", ".", "Method", "to", "allow", "derived", "handlers", "to", "customize", "the", "connection", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L539-L541
100,561
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.isProxied
protected URL isProxied(URI uri) throws MalformedURLException { // Is this a proxy request? if (isForbidden(uri)) return null; // OK return URI as untransformed URL. return new URL(uri.toString()); }
java
protected URL isProxied(URI uri) throws MalformedURLException { // Is this a proxy request? if (isForbidden(uri)) return null; // OK return URI as untransformed URL. return new URL(uri.toString()); }
[ "protected", "URL", "isProxied", "(", "URI", "uri", ")", "throws", "MalformedURLException", "{", "// Is this a proxy request?", "if", "(", "isForbidden", "(", "uri", ")", ")", "return", "null", ";", "// OK return URI as untransformed URL.", "return", "new", "URL", "...
Is URL Proxied. Method to allow derived handlers to select which URIs are proxied and to where. @param uri The requested URI, which should include a scheme, host and port. @return The URL to proxy to, or null if the passed URI should not be proxied. The default implementation returns the passed uri if isForbidden() re...
[ "Is", "URL", "Proxied", ".", "Method", "to", "allow", "derived", "handlers", "to", "select", "which", "URIs", "are", "proxied", "and", "to", "where", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L552-L560
100,562
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.isForbidden
protected boolean isForbidden(URI uri) { String scheme = uri.getScheme(); String host = uri.getHost(); int port = uri.getPort(); return isForbidden(scheme, host, port, true); }
java
protected boolean isForbidden(URI uri) { String scheme = uri.getScheme(); String host = uri.getHost(); int port = uri.getPort(); return isForbidden(scheme, host, port, true); }
[ "protected", "boolean", "isForbidden", "(", "URI", "uri", ")", "{", "String", "scheme", "=", "uri", ".", "getScheme", "(", ")", ";", "String", "host", "=", "uri", ".", "getHost", "(", ")", ";", "int", "port", "=", "uri", ".", "getPort", "(", ")", "...
Is URL Forbidden. @return True if the URL is not forbidden. Calls isForbidden(scheme,host,port,true);
[ "Is", "URL", "Forbidden", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L568-L574
100,563
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java
ProxyHandler.isForbidden
protected boolean isForbidden(String scheme, String host, int port, boolean openNonPrivPorts) { // Check port Integer p = new Integer(port); if (port > 0 && !_allowedConnectPorts.contains(p)) { if (!openNonPrivPorts || port <= 1024) return true; } ...
java
protected boolean isForbidden(String scheme, String host, int port, boolean openNonPrivPorts) { // Check port Integer p = new Integer(port); if (port > 0 && !_allowedConnectPorts.contains(p)) { if (!openNonPrivPorts || port <= 1024) return true; } ...
[ "protected", "boolean", "isForbidden", "(", "String", "scheme", ",", "String", "host", ",", "int", "port", ",", "boolean", "openNonPrivPorts", ")", "{", "// Check port", "Integer", "p", "=", "new", "Integer", "(", "port", ")", ";", "if", "(", "port", ">", ...
Is scheme,host & port Forbidden. @param scheme A scheme that mast be in the proxySchemes StringMap. @param host A host that must pass the white and black lists @param port A port that must in the allowedConnectPorts Set @param openNonPrivPorts If true ports greater than 1024 are allowed. @return True if the request to...
[ "Is", "scheme", "host", "&", "port", "Forbidden", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L586-L609
100,564
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationHandler.java
WebApplicationHandler.addFilterPathMapping
public FilterHolder addFilterPathMapping(String pathSpec, String filterName, int dispatches) { FilterHolder holder = (FilterHolder)_filterMap.get(filterName); if (holder==null) throw new IllegalArgumentException("unknown filter: "+filterName); FilterMapping mapping = new...
java
public FilterHolder addFilterPathMapping(String pathSpec, String filterName, int dispatches) { FilterHolder holder = (FilterHolder)_filterMap.get(filterName); if (holder==null) throw new IllegalArgumentException("unknown filter: "+filterName); FilterMapping mapping = new...
[ "public", "FilterHolder", "addFilterPathMapping", "(", "String", "pathSpec", ",", "String", "filterName", ",", "int", "dispatches", ")", "{", "FilterHolder", "holder", "=", "(", "FilterHolder", ")", "_filterMap", ".", "get", "(", "filterName", ")", ";", "if", ...
Add a mapping from a pathSpec to a Filter. @param pathSpec The path specification @param filterName The name of the filter (must already be added or defined) @param dispatches An integer formed by the logical OR of FilterHolder.__REQUEST, FilterHolder.__FORWARD,FilterHolder.__INCLUDE and/or FilterHolder.__ERROR. @retur...
[ "Add", "a", "mapping", "from", "a", "pathSpec", "to", "a", "Filter", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationHandler.java#L123-L132
100,565
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationHandler.java
WebApplicationHandler.addFilterServletMapping
public FilterHolder addFilterServletMapping(String servletName, String filterName, int dispatches) { FilterHolder holder= (FilterHolder)_filterMap.get(filterName); if (holder == null) throw new IllegalArgumentException("Unknown filter :" + filterName); _servletFilterMap.add(servl...
java
public FilterHolder addFilterServletMapping(String servletName, String filterName, int dispatches) { FilterHolder holder= (FilterHolder)_filterMap.get(filterName); if (holder == null) throw new IllegalArgumentException("Unknown filter :" + filterName); _servletFilterMap.add(servl...
[ "public", "FilterHolder", "addFilterServletMapping", "(", "String", "servletName", ",", "String", "filterName", ",", "int", "dispatches", ")", "{", "FilterHolder", "holder", "=", "(", "FilterHolder", ")", "_filterMap", ".", "get", "(", "filterName", ")", ";", "i...
Add a servlet filter mapping @param servletName The name of the servlet to be filtered. @param filterName The name of the filter. @param dispatches An integer formed by the logical OR of FilterHolder.__REQUEST, FilterHolder.__FORWARD,FilterHolder.__INCLUDE and/or FilterHolder.__ERROR. @return The holder of the filter i...
[ "Add", "a", "servlet", "filter", "mapping" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/WebApplicationHandler.java#L144-L151
100,566
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpResponse.java
ServletHttpResponse.unwrap
public static ServletHttpResponse unwrap(ServletResponse response) { while (!(response instanceof ServletHttpResponse)) { if (response instanceof ServletResponseWrapper) { ServletResponseWrapper wrapper = (ServletResponseWrapper)response; ...
java
public static ServletHttpResponse unwrap(ServletResponse response) { while (!(response instanceof ServletHttpResponse)) { if (response instanceof ServletResponseWrapper) { ServletResponseWrapper wrapper = (ServletResponseWrapper)response; ...
[ "public", "static", "ServletHttpResponse", "unwrap", "(", "ServletResponse", "response", ")", "{", "while", "(", "!", "(", "response", "instanceof", "ServletHttpResponse", ")", ")", "{", "if", "(", "response", "instanceof", "ServletResponseWrapper", ")", "{", "Ser...
Unwrap a ServletResponse. @see javax.servlet.ServletResponseWrapper @see javax.servlet.http.HttpServletResponseWrapper @param response @return The core ServletHttpResponse which must be the underlying response object
[ "Unwrap", "a", "ServletResponse", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/jetty/servlet/ServletHttpResponse.java#L678-L693
100,567
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.toArray
public static int[] toArray(String s, int family) { byte[] byteArray = toByteArray(s, family); if (byteArray == null) return null; int[] intArray = new int[byteArray.length]; for (int i = 0; i < byteArray.length; i++) intArray[i] = byteArray[i] & 0xFF; ...
java
public static int[] toArray(String s, int family) { byte[] byteArray = toByteArray(s, family); if (byteArray == null) return null; int[] intArray = new int[byteArray.length]; for (int i = 0; i < byteArray.length; i++) intArray[i] = byteArray[i] & 0xFF; ...
[ "public", "static", "int", "[", "]", "toArray", "(", "String", "s", ",", "int", "family", ")", "{", "byte", "[", "]", "byteArray", "=", "toByteArray", "(", "s", ",", "family", ")", ";", "if", "(", "byteArray", "==", "null", ")", "return", "null", "...
Convert a string containing an IP address to an array of 4 or 16 integers. @param s The address, in text format. @param family The address family. @return The address
[ "Convert", "a", "string", "containing", "an", "IP", "address", "to", "an", "array", "of", "4", "or", "16", "integers", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L168-L177
100,568
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.toByteArray
public static byte[] toByteArray(String s, int family) { if (family == IPv4) return parseV4(s); else if (family == IPv6) return parseV6(s); else throw new IllegalArgumentException("unknown address family"); }
java
public static byte[] toByteArray(String s, int family) { if (family == IPv4) return parseV4(s); else if (family == IPv6) return parseV6(s); else throw new IllegalArgumentException("unknown address family"); }
[ "public", "static", "byte", "[", "]", "toByteArray", "(", "String", "s", ",", "int", "family", ")", "{", "if", "(", "family", "==", "IPv4", ")", "return", "parseV4", "(", "s", ")", ";", "else", "if", "(", "family", "==", "IPv6", ")", "return", "par...
Convert a string containing an IP address to an array of 4 or 16 bytes. @param s The address, in text format. @param family The address family. @return The address
[ "Convert", "a", "string", "containing", "an", "IP", "address", "to", "an", "array", "of", "4", "or", "16", "bytes", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L197-L205
100,569
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.isDottedQuad
public static boolean isDottedQuad(String s) { byte[] address = Address.toByteArray(s, IPv4); return (address != null); }
java
public static boolean isDottedQuad(String s) { byte[] address = Address.toByteArray(s, IPv4); return (address != null); }
[ "public", "static", "boolean", "isDottedQuad", "(", "String", "s", ")", "{", "byte", "[", "]", "address", "=", "Address", ".", "toByteArray", "(", "s", ",", "IPv4", ")", ";", "return", "(", "address", "!=", "null", ")", ";", "}" ]
Determines if a string contains a valid IP address. @param s The string @return Whether the string contains a valid IP address
[ "Determines", "if", "a", "string", "contains", "a", "valid", "IP", "address", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L213-L217
100,570
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByName
public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record[] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
java
public static InetAddress getByName(String name) throws UnknownHostException { try { return getByAddress(name); } catch (UnknownHostException e) { Record[] records = lookupHostName(name); return addrFromRecord(name, records[0]); } }
[ "public", "static", "InetAddress", "getByName", "(", "String", "name", ")", "throws", "UnknownHostException", "{", "try", "{", "return", "getByAddress", "(", "name", ")", ";", "}", "catch", "(", "UnknownHostException", "e", ")", "{", "Record", "[", "]", "rec...
Determines the IP address of a host @param name The hostname to look up @return The first matching IP address @throws UnknownHostException The hostname does not have any addresses
[ "Determines", "the", "IP", "address", "of", "a", "host" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L268-L276
100,571
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getAllByName
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
java
public static InetAddress[] getAllByName(String name) throws UnknownHostException { try { InetAddress addr = getByAddress(name); return new InetAddress[]{addr}; } catch (UnknownHostException e) { Record[] records = lookupHostName(name); InetAddress[] a...
[ "public", "static", "InetAddress", "[", "]", "getAllByName", "(", "String", "name", ")", "throws", "UnknownHostException", "{", "try", "{", "InetAddress", "addr", "=", "getByAddress", "(", "name", ")", ";", "return", "new", "InetAddress", "[", "]", "{", "add...
Determines all IP address of a host @param name The hostname to look up @return All matching IP addresses @throws UnknownHostException The hostname does not have any addresses
[ "Determines", "all", "IP", "address", "of", "a", "host" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L285-L297
100,572
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByAddress
public static InetAddress getByAddress(String addr) throws UnknownHostException { byte[] bytes; bytes = toByteArray(addr, IPv4); if (bytes != null) return InetAddress.getByAddress(bytes); bytes = toByteArray(addr, IPv6); if (bytes != null) return InetA...
java
public static InetAddress getByAddress(String addr) throws UnknownHostException { byte[] bytes; bytes = toByteArray(addr, IPv4); if (bytes != null) return InetAddress.getByAddress(bytes); bytes = toByteArray(addr, IPv6); if (bytes != null) return InetA...
[ "public", "static", "InetAddress", "getByAddress", "(", "String", "addr", ")", "throws", "UnknownHostException", "{", "byte", "[", "]", "bytes", ";", "bytes", "=", "toByteArray", "(", "addr", ",", "IPv4", ")", ";", "if", "(", "bytes", "!=", "null", ")", ...
Converts an address from its string representation to an IP address. The address can be either IPv4 or IPv6. @param addr The address, in string form @return The IP addresses @throws UnknownHostException The address is not a valid IP address.
[ "Converts", "an", "address", "from", "its", "string", "representation", "to", "an", "IP", "address", ".", "The", "address", "can", "be", "either", "IPv4", "or", "IPv6", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L307-L317
100,573
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.getByAddress
public static InetAddress getByAddress(String addr, int family) throws UnknownHostException { if (family != IPv4 && family != IPv6) throw new IllegalArgumentException("unknown address family"); byte[] bytes; bytes = toByteArray(addr, family); if (bytes != null) ...
java
public static InetAddress getByAddress(String addr, int family) throws UnknownHostException { if (family != IPv4 && family != IPv6) throw new IllegalArgumentException("unknown address family"); byte[] bytes; bytes = toByteArray(addr, family); if (bytes != null) ...
[ "public", "static", "InetAddress", "getByAddress", "(", "String", "addr", ",", "int", "family", ")", "throws", "UnknownHostException", "{", "if", "(", "family", "!=", "IPv4", "&&", "family", "!=", "IPv6", ")", "throw", "new", "IllegalArgumentException", "(", "...
Converts an address from its string representation to an IP address in a particular family. @param addr The address, in string form @param family The address family, either IPv4 or IPv6. @return The IP addresses @throws UnknownHostException The address is not a valid IP address in the specified address family.
[ "Converts", "an", "address", "from", "its", "string", "representation", "to", "an", "IP", "address", "in", "a", "particular", "family", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L329-L338
100,574
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/Address.java
Address.familyOf
public static int familyOf(InetAddress address) { if (address instanceof Inet4Address) return IPv4; if (address instanceof Inet6Address) return IPv6; throw new IllegalArgumentException("unknown address family"); }
java
public static int familyOf(InetAddress address) { if (address instanceof Inet4Address) return IPv4; if (address instanceof Inet6Address) return IPv6; throw new IllegalArgumentException("unknown address family"); }
[ "public", "static", "int", "familyOf", "(", "InetAddress", "address", ")", "{", "if", "(", "address", "instanceof", "Inet4Address", ")", "return", "IPv4", ";", "if", "(", "address", "instanceof", "Inet6Address", ")", "return", "IPv6", ";", "throw", "new", "I...
Returns the family of an InetAddress. @param address The supplied address. @return The family, either IPv4 or IPv6.
[ "Returns", "the", "family", "of", "an", "InetAddress", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/Address.java#L363-L370
100,575
webmetrics/browsermob-proxy
src/main/java/org/xbill/DNS/utils/base16.java
base16.fromString
public static byte [] fromString(String str) { ByteArrayOutputStream bs = new ByteArrayOutputStream(); byte [] raw = str.getBytes(); for (int i = 0; i < raw.length; i++) { if (!Character.isWhitespace((char)raw[i])) bs.write(raw[i]); } byte [] in = bs.toByteArray(); if (in.length % 2 != 0) { return null; }...
java
public static byte [] fromString(String str) { ByteArrayOutputStream bs = new ByteArrayOutputStream(); byte [] raw = str.getBytes(); for (int i = 0; i < raw.length; i++) { if (!Character.isWhitespace((char)raw[i])) bs.write(raw[i]); } byte [] in = bs.toByteArray(); if (in.length % 2 != 0) { return null; }...
[ "public", "static", "byte", "[", "]", "fromString", "(", "String", "str", ")", "{", "ByteArrayOutputStream", "bs", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "byte", "[", "]", "raw", "=", "str", ".", "getBytes", "(", ")", ";", "for", "(", "int...
Convert a hex-encoded String to binary data @param str A String containing the encoded data @return An array containing the binary data, or null if the string is invalid
[ "Convert", "a", "hex", "-", "encoded", "String", "to", "binary", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/xbill/DNS/utils/base16.java#L47-L73
100,576
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.put
public void put(Object o) throws InterruptedException { synchronized(lock) { while (size==maxSize) lock.wait(); elements[tail]=o; if(++tail==maxSize) tail=0; size++; lock.notify(); } }
java
public void put(Object o) throws InterruptedException { synchronized(lock) { while (size==maxSize) lock.wait(); elements[tail]=o; if(++tail==maxSize) tail=0; size++; lock.notify(); } }
[ "public", "void", "put", "(", "Object", "o", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "size", "==", "maxSize", ")", "lock", ".", "wait", "(", ")", ";", "elements", "[", "tail", "]", "=", "o", ";...
Put object in queue. @param o Object
[ "Put", "object", "in", "queue", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L86-L100
100,577
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.get
public Object get() throws InterruptedException { synchronized(lock) { while (size==0) lock.wait(); Object o = elements[head]; elements[head]=null; if(++head==maxSize) head=0; if (size==m...
java
public Object get() throws InterruptedException { synchronized(lock) { while (size==0) lock.wait(); Object o = elements[head]; elements[head]=null; if(++head==maxSize) head=0; if (size==m...
[ "public", "Object", "get", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "while", "(", "size", "==", "0", ")", "lock", ".", "wait", "(", ")", ";", "Object", "o", "=", "elements", "[", "head", "]", ";", "eleme...
Get object from queue. Block if there are no objects to get. @return The next object in the queue.
[ "Get", "object", "from", "queue", ".", "Block", "if", "there", "are", "no", "objects", "to", "get", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L133-L150
100,578
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java
BlockingQueue.peek
public Object peek() throws InterruptedException { synchronized(lock) { if (size==0) lock.wait(); if (size==0) return null; Object o = elements[head]; return o; } }
java
public Object peek() throws InterruptedException { synchronized(lock) { if (size==0) lock.wait(); if (size==0) return null; Object o = elements[head]; return o; } }
[ "public", "Object", "peek", "(", ")", "throws", "InterruptedException", "{", "synchronized", "(", "lock", ")", "{", "if", "(", "size", "==", "0", ")", "lock", ".", "wait", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "null", ";", "Ob...
Peek at the queue. Block if there are no objects to peek. @return The next object in the queue, or null if timedout.
[ "Peek", "at", "the", "queue", ".", "Block", "if", "there", "are", "no", "objects", "to", "peek", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/BlockingQueue.java#L188-L202
100,579
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/JarFileResource.java
JarFileResource.exists
public boolean exists() { if (_exists) return true; if (_urlString.endsWith("!/")) { String file_url=_urlString.substring(4,_urlString.length()-2); try{return newResource(file_url).exists();} catch(Exception e) {LogSupport.ignore(log,e); retur...
java
public boolean exists() { if (_exists) return true; if (_urlString.endsWith("!/")) { String file_url=_urlString.substring(4,_urlString.length()-2); try{return newResource(file_url).exists();} catch(Exception e) {LogSupport.ignore(log,e); retur...
[ "public", "boolean", "exists", "(", ")", "{", "if", "(", "_exists", ")", "return", "true", ";", "if", "(", "_urlString", ".", "endsWith", "(", "\"!/\"", ")", ")", "{", "String", "file_url", "=", "_urlString", ".", "substring", "(", "4", ",", "_urlStrin...
Returns true if the respresenetd resource exists.
[ "Returns", "true", "if", "the", "respresenetd", "resource", "exists", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/JarFileResource.java#L103-L183
100,580
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.parse
public UserAgentInfo parse(String useragent) throws IOException { UserAgentInfo retObj = new UserAgentInfo(); if (useragent == null) { return retObj; } useragent = useragent.trim(); // check that the data maps are up-to-date checkDataMaps(); // first check if it's a robot if (!processRobot(userage...
java
public UserAgentInfo parse(String useragent) throws IOException { UserAgentInfo retObj = new UserAgentInfo(); if (useragent == null) { return retObj; } useragent = useragent.trim(); // check that the data maps are up-to-date checkDataMaps(); // first check if it's a robot if (!processRobot(userage...
[ "public", "UserAgentInfo", "parse", "(", "String", "useragent", ")", "throws", "IOException", "{", "UserAgentInfo", "retObj", "=", "new", "UserAgentInfo", "(", ")", ";", "if", "(", "useragent", "==", "null", ")", "{", "return", "retObj", ";", "}", "useragent...
Parse the given user agent string and returns a UserAgentInfo object with the related data @param useragent @throws IOException may happen when the retrieval of the data file fails @return
[ "Parse", "the", "given", "user", "agent", "string", "and", "returns", "a", "UserAgentInfo", "object", "with", "the", "related", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L77-L99
100,581
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processOsRegex
private void processOsRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); for (Map.Entry<Pattern, Long> entry : osRegMap.entrySet()) { Matcher matcher = entry.getKey().matcher(useragent); if (matcher.find()) { // simply ...
java
private void processOsRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); for (Map.Entry<Pattern, Long> entry : osRegMap.entrySet()) { Matcher matcher = entry.getKey().matcher(useragent); if (matcher.find()) { // simply ...
[ "private", "void", "processOsRegex", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "Pattern", ",", "Long", ">", "entry", ":", "osRegMap", ".",...
Searches in the os regex table. if found a match copies the os data @param useragent @param retObj
[ "Searches", "in", "the", "os", "regex", "table", ".", "if", "found", "a", "match", "copies", "the", "os", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L107-L126
100,582
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processBrowserRegex
private boolean processBrowserRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); boolean osFound = false; for (Map.Entry<String, Long> entry : browserRegMap.entrySet()) { Pattern pattern = Pattern.compile(entry.getKey(), Pattern.CASE_INSENSITIV...
java
private boolean processBrowserRegex(String useragent, UserAgentInfo retObj) { try { lock.lock(); boolean osFound = false; for (Map.Entry<String, Long> entry : browserRegMap.entrySet()) { Pattern pattern = Pattern.compile(entry.getKey(), Pattern.CASE_INSENSITIV...
[ "private", "boolean", "processBrowserRegex", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "boolean", "osFound", "=", "false", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",...
Searchs in the browser regex table. if found a match copies the browser data and if possible os data @param useragent @param retObj @return
[ "Searchs", "in", "the", "browser", "regex", "table", ".", "if", "found", "a", "match", "copies", "the", "browser", "data", "and", "if", "possible", "os", "data" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L135-L174
100,583
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.copyType
private void copyType(UserAgentInfo retObj, Long idBrowser) { try { lock.lock(); BrowserEntry be = browserMap.get(idBrowser); if (be != null) { Long type = be.getType(); if (type != null) { String typeString = browserTypeMa...
java
private void copyType(UserAgentInfo retObj, Long idBrowser) { try { lock.lock(); BrowserEntry be = browserMap.get(idBrowser); if (be != null) { Long type = be.getType(); if (type != null) { String typeString = browserTypeMa...
[ "private", "void", "copyType", "(", "UserAgentInfo", "retObj", ",", "Long", "idBrowser", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "BrowserEntry", "be", "=", "browserMap", ".", "get", "(", "idBrowser", ")", ";", "if", "(", "be", "!=", ...
Sets the source type, if possible @param retObj @param idBrowser
[ "Sets", "the", "source", "type", "if", "possible" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L182-L199
100,584
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/UASparser.java
UASparser.processRobot
private boolean processRobot(String useragent, UserAgentInfo retObj) { try { lock.lock(); if (robotsMap.containsKey(useragent)) { retObj.setTyp("Robot"); RobotEntry robotEntry = robotsMap.get(useragent); robotEntry.copyTo(retObj); ...
java
private boolean processRobot(String useragent, UserAgentInfo retObj) { try { lock.lock(); if (robotsMap.containsKey(useragent)) { retObj.setTyp("Robot"); RobotEntry robotEntry = robotsMap.get(useragent); robotEntry.copyTo(retObj); ...
[ "private", "boolean", "processRobot", "(", "String", "useragent", ",", "UserAgentInfo", "retObj", ")", "{", "try", "{", "lock", ".", "lock", "(", ")", ";", "if", "(", "robotsMap", ".", "containsKey", "(", "useragent", ")", ")", "{", "retObj", ".", "setTy...
Checks if the useragent comes from a robot. if yes copies all the data to the result object @param useragent @param retObj @return true if the useragent belongs to a robot, else false
[ "Checks", "if", "the", "useragent", "comes", "from", "a", "robot", ".", "if", "yes", "copies", "all", "the", "data", "to", "the", "result", "object" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L208-L228
100,585
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java
TrustEverythingSSLTrustManager.getTrustingSSLSocketFactory
public synchronized static SSLSocketFactory getTrustingSSLSocketFactory() { if (socketFactory != null) return socketFactory; TrustManager[] trustManagers = new TrustManager[] { new TrustEverythingSSLTrustManager() }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); ...
java
public synchronized static SSLSocketFactory getTrustingSSLSocketFactory() { if (socketFactory != null) return socketFactory; TrustManager[] trustManagers = new TrustManager[] { new TrustEverythingSSLTrustManager() }; SSLContext sc; try { sc = SSLContext.getInstance("SSL"); ...
[ "public", "synchronized", "static", "SSLSocketFactory", "getTrustingSSLSocketFactory", "(", ")", "{", "if", "(", "socketFactory", "!=", "null", ")", "return", "socketFactory", ";", "TrustManager", "[", "]", "trustManagers", "=", "new", "TrustManager", "[", "]", "{...
Returns an SSLSocketFactory that will trust all SSL certificates; this is suitable for passing to HttpsURLConnection, either to its instance method setSSLSocketFactory, or to its static method setDefaultSSLSocketFactory. @see javax.net.ssl.HttpsURLConnection#setSSLSocketFactory(SSLSocketFactory) @see javax.net.ssl.Http...
[ "Returns", "an", "SSLSocketFactory", "that", "will", "trust", "all", "SSL", "certificates", ";", "this", "is", "suitable", "for", "passing", "to", "HttpsURLConnection", "either", "to", "its", "instance", "method", "setSSLSocketFactory", "or", "to", "its", "static"...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java#L31-L43
100,586
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java
TrustEverythingSSLTrustManager.trustAllSSLCertificates
public static void trustAllSSLCertificates(HttpsURLConnection connection) { getTrustingSSLSocketFactory(); connection.setSSLSocketFactory(socketFactory); connection.setHostnameVerifier(new HostnameVerifier() { public boolean verify(String s, SSLSession sslSession) { r...
java
public static void trustAllSSLCertificates(HttpsURLConnection connection) { getTrustingSSLSocketFactory(); connection.setSSLSocketFactory(socketFactory); connection.setHostnameVerifier(new HostnameVerifier() { public boolean verify(String s, SSLSession sslSession) { r...
[ "public", "static", "void", "trustAllSSLCertificates", "(", "HttpsURLConnection", "connection", ")", "{", "getTrustingSSLSocketFactory", "(", ")", ";", "connection", ".", "setSSLSocketFactory", "(", "socketFactory", ")", ";", "connection", ".", "setHostnameVerifier", "(...
Configures a single HttpsURLConnection to trust all SSL certificates. @param connection an HttpsURLConnection which will be configured to trust all certs
[ "Configures", "a", "single", "HttpsURLConnection", "to", "trust", "all", "SSL", "certificates", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/util/TrustEverythingSSLTrustManager.java#L58-L66
100,587
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java
KeyPairTool.doit
private void doit(String[] args) { try { // load parameters from the commandline loadParameters(args); // Try to load the private key importKeyPair(); } catch (Exception e) { System.out.println("Exception: " + e.get...
java
private void doit(String[] args) { try { // load parameters from the commandline loadParameters(args); // Try to load the private key importKeyPair(); } catch (Exception e) { System.out.println("Exception: " + e.get...
[ "private", "void", "doit", "(", "String", "[", "]", "args", ")", "{", "try", "{", "// load parameters from the commandline", "loadParameters", "(", "args", ")", ";", "// Try to load the private key", "importKeyPair", "(", ")", ";", "}", "catch", "(", "Exception", ...
Load parameters and perform the import command. Catch any exceptions and clear the password arrays. @param args String array containing command line arguments
[ "Load", "parameters", "and", "perform", "the", "import", "command", ".", "Catch", "any", "exceptions", "and", "clear", "the", "password", "arrays", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java#L92-L109
100,588
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java
KeyPairTool.loadPrivateKey
private PrivateKey loadPrivateKey(File privateKeyFile) throws Exception { // Load the key file. System.out.println("Loading private key from " + privateKeyFile + ", using " + providerClassName + " as the private key loading provider"); FileInputStream...
java
private PrivateKey loadPrivateKey(File privateKeyFile) throws Exception { // Load the key file. System.out.println("Loading private key from " + privateKeyFile + ", using " + providerClassName + " as the private key loading provider"); FileInputStream...
[ "private", "PrivateKey", "loadPrivateKey", "(", "File", "privateKeyFile", ")", "throws", "Exception", "{", "// Load the key file.", "System", ".", "out", ".", "println", "(", "\"Loading private key from \"", "+", "privateKeyFile", "+", "\", using \"", "+", "providerClas...
Load an RSA private key from the given File @param privateKeyFile String name of file to load the key from @return PrivateKey loaded from the file @throws Exception if there are problems with loading the key.
[ "Load", "an", "RSA", "private", "key", "from", "the", "given", "File" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/KeyPairTool.java#L225-L269
100,589
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java
NCSARequestLog.setFilename
public void setFilename(String filename) { if (filename!=null) { filename=filename.trim(); if (filename.length()==0) filename=null; } _filename=filename; }
java
public void setFilename(String filename) { if (filename!=null) { filename=filename.trim(); if (filename.length()==0) filename=null; } _filename=filename; }
[ "public", "void", "setFilename", "(", "String", "filename", ")", "{", "if", "(", "filename", "!=", "null", ")", "{", "filename", "=", "filename", ".", "trim", "(", ")", ";", "if", "(", "filename", ".", "length", "(", ")", "==", "0", ")", "filename", ...
Set the log filename. @see NCSARequestLog#setRetainDays(int) @param filename The filename to use. If the filename contains the string "yyyy_mm_dd", then a RolloverFileOutputStream is used and the log is rolled over nightly and aged according setRetainDays. If no filename is set or a null filename passed, then requests ...
[ "Set", "the", "log", "filename", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java#L99-L108
100,590
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java
NCSARequestLog.logExtended
protected void logExtended(HttpRequest request, HttpResponse response, Writer log) throws IOException { String referer = request.getField(HttpFields.__Referer); if(referer==null) log.write("\"-\" "); else ...
java
protected void logExtended(HttpRequest request, HttpResponse response, Writer log) throws IOException { String referer = request.getField(HttpFields.__Referer); if(referer==null) log.write("\"-\" "); else ...
[ "protected", "void", "logExtended", "(", "HttpRequest", "request", ",", "HttpResponse", "response", ",", "Writer", "log", ")", "throws", "IOException", "{", "String", "referer", "=", "request", ".", "getField", "(", "HttpFields", ".", "__Referer", ")", ";", "i...
Log Extended fields. This method can be extended by a derived class to add extened fields to each log entry. It is called by the log method after all standard fields have been added, but before the line terminator. Derived implementations should write extra fields to the Writer provided. The default implementation wri...
[ "Log", "Extended", "fields", ".", "This", "method", "can", "be", "extended", "by", "a", "derived", "class", "to", "add", "extened", "fields", "to", "each", "log", "entry", ".", "It", "is", "called", "by", "the", "log", "method", "after", "all", "standard...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/NCSARequestLog.java#L472-L498
100,591
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.setHeaderValue
public void setHeaderValue(String name,String value) { _fields.put(name,Collections.singletonList(value)); }
java
public void setHeaderValue(String name,String value) { _fields.put(name,Collections.singletonList(value)); }
[ "public", "void", "setHeaderValue", "(", "String", "name", ",", "String", "value", ")", "{", "_fields", ".", "put", "(", "name", ",", "Collections", ".", "singletonList", "(", "value", ")", ")", ";", "}" ]
Set a header override, every response handled will have this header set. @param name The String name of the header. @param value The String value of the header.
[ "Set", "a", "header", "override", "every", "response", "handled", "will", "have", "this", "header", "set", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L50-L53
100,592
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.setHeaderValues
public void setHeaderValues(String name,String[] values) { _fields.put(name,Arrays.asList(values)); }
java
public void setHeaderValues(String name,String[] values) { _fields.put(name,Arrays.asList(values)); }
[ "public", "void", "setHeaderValues", "(", "String", "name", ",", "String", "[", "]", "values", ")", "{", "_fields", ".", "put", "(", "name", ",", "Arrays", ".", "asList", "(", "values", ")", ")", ";", "}" ]
Set a multivalued header, every response handled will have this header set with the provided values. @param name The String name of the header. @param values An Array of String values to use as the values for a Header.
[ "Set", "a", "multivalued", "header", "every", "response", "handled", "will", "have", "this", "header", "set", "with", "the", "provided", "values", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L62-L65
100,593
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java
SetResponseHeadersHandler.handle
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException,IOException { log.debug("SetResponseHeadersHandler.handle()"); for (Iterator iterator=_fields...
java
public void handle(String pathInContext, String pathParams, HttpRequest request, HttpResponse response) throws HttpException,IOException { log.debug("SetResponseHeadersHandler.handle()"); for (Iterator iterator=_fields...
[ "public", "void", "handle", "(", "String", "pathInContext", ",", "String", "pathParams", ",", "HttpRequest", "request", ",", "HttpResponse", "response", ")", "throws", "HttpException", ",", "IOException", "{", "log", ".", "debug", "(", "\"SetResponseHeadersHandler.h...
Handle a request by pre-populating the headers from the configured set of _fields. Settings made here can be overridden by subsequent handling of the request. @param pathInContext The context path. Ignored. @param pathParams Path parameters such as encoded Session ID. Ignored. @param request The HttpRequest request. ...
[ "Handle", "a", "request", "by", "pre", "-", "populating", "the", "headers", "from", "the", "configured", "set", "of", "_fields", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/SetResponseHeadersHandler.java#L79-L94
100,594
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java
TrustingSSLSocketFactory.createSimulatedSocket
private Socket createSimulatedSocket(SSLSocket socket) { SimulatedSocketFactory.configure(socket); socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } ); //socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" }); return new ...
java
private Socket createSimulatedSocket(SSLSocket socket) { SimulatedSocketFactory.configure(socket); socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } ); //socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" }); return new ...
[ "private", "Socket", "createSimulatedSocket", "(", "SSLSocket", "socket", ")", "{", "SimulatedSocketFactory", ".", "configure", "(", "socket", ")", ";", "socket", ".", "setEnabledProtocols", "(", "new", "String", "[", "]", "{", "SSLAlgorithm", ".", "SSLv3", ".",...
just an helper function to wrap a normal sslSocket into a simulated one so we can do throttling
[ "just", "an", "helper", "function", "to", "wrap", "a", "normal", "sslSocket", "into", "a", "simulated", "one", "so", "we", "can", "do", "throttling" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java#L74-L79
100,595
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.checkDataMaps
@Override protected synchronized void checkDataMaps() throws IOException { if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) { String versionOnServer = getVersionFromServer(); if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) { loadDataFro...
java
@Override protected synchronized void checkDataMaps() throws IOException { if (lastUpdateCheck == 0 || lastUpdateCheck < System.currentTimeMillis() - updateInterval) { String versionOnServer = getVersionFromServer(); if (currentVersion == null || versionOnServer.compareTo(currentVersion) > 0) { loadDataFro...
[ "@", "Override", "protected", "synchronized", "void", "checkDataMaps", "(", ")", "throws", "IOException", "{", "if", "(", "lastUpdateCheck", "==", "0", "||", "lastUpdateCheck", "<", "System", ".", "currentTimeMillis", "(", ")", "-", "updateInterval", ")", "{", ...
This implementation uses a local properties file to keep the lastUpdate time and the local data file version
[ "This", "implementation", "uses", "a", "local", "properties", "file", "to", "keep", "the", "lastUpdate", "time", "and", "the", "local", "data", "file", "version" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L68-L82
100,596
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.loadDataFromInternetAndSave
private void loadDataFromInternetAndSave() throws IOException { InputStream is = null; FileOutputStream fos = null; try { URL url = new URL(DATA_RETRIVE_URL); is = url.openStream(); fos = new FileOutputStream(getCacheFile()); byte[] buff = new byte[1024 * 8]; int len = 0; while ((len = is.read(b...
java
private void loadDataFromInternetAndSave() throws IOException { InputStream is = null; FileOutputStream fos = null; try { URL url = new URL(DATA_RETRIVE_URL); is = url.openStream(); fos = new FileOutputStream(getCacheFile()); byte[] buff = new byte[1024 * 8]; int len = 0; while ((len = is.read(b...
[ "private", "void", "loadDataFromInternetAndSave", "(", ")", "throws", "IOException", "{", "InputStream", "is", "=", "null", ";", "FileOutputStream", "fos", "=", "null", ";", "try", "{", "URL", "url", "=", "new", "URL", "(", "DATA_RETRIVE_URL", ")", ";", "is"...
loads the data file from the server and saves it to the local file system @throws IOException
[ "loads", "the", "data", "file", "from", "the", "server", "and", "saves", "it", "to", "the", "local", "file", "system" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L97-L118
100,597
webmetrics/browsermob-proxy
src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java
CachingOnlineUpdateUASparser.saveProperties
private void saveProperties(Properties prop) throws FileNotFoundException, IOException { FileOutputStream fos = new FileOutputStream(getPropertiesFile()); try { prop.store(fos, null); } finally { fos.close(); } }
java
private void saveProperties(Properties prop) throws FileNotFoundException, IOException { FileOutputStream fos = new FileOutputStream(getPropertiesFile()); try { prop.store(fos, null); } finally { fos.close(); } }
[ "private", "void", "saveProperties", "(", "Properties", "prop", ")", "throws", "FileNotFoundException", ",", "IOException", "{", "FileOutputStream", "fos", "=", "new", "FileOutputStream", "(", "getPropertiesFile", "(", ")", ")", ";", "try", "{", "prop", ".", "st...
Saves the properties file to the local filesystem @param prop @throws FileNotFoundException @throws IOException
[ "Saves", "the", "properties", "file", "to", "the", "local", "filesystem" ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/CachingOnlineUpdateUASparser.java#L127-L134
100,598
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java
ThreadedServer.setInetAddrPort
public synchronized void setInetAddrPort(InetAddrPort address) { if (_address != null && _address.equals(address)) return; if (isStarted()) log.warn(this + " is started"); _address = address; }
java
public synchronized void setInetAddrPort(InetAddrPort address) { if (_address != null && _address.equals(address)) return; if (isStarted()) log.warn(this + " is started"); _address = address; }
[ "public", "synchronized", "void", "setInetAddrPort", "(", "InetAddrPort", "address", ")", "{", "if", "(", "_address", "!=", "null", "&&", "_address", ".", "equals", "(", "address", ")", ")", "return", ";", "if", "(", "isStarted", "(", ")", ")", "log", "....
Set the server InetAddress and port. @param address The Address to listen on, or 0.0.0.0:port for all interfaces.
[ "Set", "the", "server", "InetAddress", "and", "port", "." ]
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L119-L126
100,599
webmetrics/browsermob-proxy
src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java
ThreadedServer.open
public void open() throws IOException { if (_listen == null) { _listen = newServerSocket(_address, _acceptQueueSize); if (_address == null) _address = new InetAddrPort(_listen.getInetAddress(), _listen.getLocalPort()); else { ...
java
public void open() throws IOException { if (_listen == null) { _listen = newServerSocket(_address, _acceptQueueSize); if (_address == null) _address = new InetAddrPort(_listen.getInetAddress(), _listen.getLocalPort()); else { ...
[ "public", "void", "open", "(", ")", "throws", "IOException", "{", "if", "(", "_listen", "==", "null", ")", "{", "_listen", "=", "newServerSocket", "(", "_address", ",", "_acceptQueueSize", ")", ";", "if", "(", "_address", "==", "null", ")", "_address", "...
Open the server socket. This method can be called to open the server socket in advance of starting the listener. This can be used to test if the port is available. @exception IOException if an error occurs
[ "Open", "the", "server", "socket", ".", "This", "method", "can", "be", "called", "to", "open", "the", "server", "socket", "in", "advance", "of", "starting", "the", "listener", ".", "This", "can", "be", "used", "to", "test", "if", "the", "port", "is", "...
a9252e62246ac33d55d51b993ba1159404e7d389
https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L473-L491