repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/email/message/Email.java | Email.cc | public Email cc(EmailAddress... cc) {
for (EmailAddress c : cc) {
recipient(c, RecipientType.CC);
}
return this;
} | java | public Email cc(EmailAddress... cc) {
for (EmailAddress c : cc) {
recipient(c, RecipientType.CC);
}
return this;
} | [
"public",
"Email",
"cc",
"(",
"EmailAddress",
"...",
"cc",
")",
"{",
"for",
"(",
"EmailAddress",
"c",
":",
"cc",
")",
"{",
"recipient",
"(",
"c",
",",
"RecipientType",
".",
"CC",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Add a "cc" recipient address.
@param cc
one or several recipient addresses
@return this instance for fluent chaining | [
"Add",
"a",
"cc",
"recipient",
"address",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/email/message/Email.java#L353-L358 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/email/message/Email.java | Email.bcc | public Email bcc(EmailAddress... bcc) {
for (EmailAddress b : bcc) {
recipient(b, RecipientType.BCC);
}
return this;
} | java | public Email bcc(EmailAddress... bcc) {
for (EmailAddress b : bcc) {
recipient(b, RecipientType.BCC);
}
return this;
} | [
"public",
"Email",
"bcc",
"(",
"EmailAddress",
"...",
"bcc",
")",
"{",
"for",
"(",
"EmailAddress",
"b",
":",
"bcc",
")",
"{",
"recipient",
"(",
"b",
",",
"RecipientType",
".",
"BCC",
")",
";",
"}",
"return",
"this",
";",
"}"
] | Add a "bcc" recipient address.
@param bcc
one or several recipient addresses
@return this instance for fluent chaining | [
"Add",
"a",
"bcc",
"recipient",
"address",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/email/message/Email.java#L382-L387 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/sms/builder/SmsBuilder.java | SmsBuilder.sender | public <T extends Builder<? extends MessageSender>> T sender(Class<T> builderClass) {
return senderBuilderHelper.register(builderClass);
} | java | public <T extends Builder<? extends MessageSender>> T sender(Class<T> builderClass) {
return senderBuilderHelper.register(builderClass);
} | [
"public",
"<",
"T",
"extends",
"Builder",
"<",
"?",
"extends",
"MessageSender",
">",
">",
"T",
"sender",
"(",
"Class",
"<",
"T",
">",
"builderClass",
")",
"{",
"return",
"senderBuilderHelper",
".",
"register",
"(",
"builderClass",
")",
";",
"}"
] | Registers and configures sender through a dedicated builder.
For example:
<pre>
.sender(CloudhopperBuilder.class)
.host("localhost");
</pre>
<p>
If your custom builder is annotated by one or several of:
<ul>
<li>{@link RequiredClass}</li>
<li>{@link RequiredProperty}</li>
<li>{@link RequiredClasses}</li>
<li>{@link ... | [
"Registers",
"and",
"configures",
"sender",
"through",
"a",
"dedicated",
"builder",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/sms/builder/SmsBuilder.java#L510-L512 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/html/inliner/impl/jsoup/ImageInlineUtils.java | ImageInlineUtils.isInlineModeAllowed | public static boolean isInlineModeAllowed(Element img, InlineMode mode) {
// if already inlined => reject (do not inline twice)
if (!img.attr(INLINED_ATTR).isEmpty()) {
return false;
}
// if inline mode defined but not the wanted mode => reject
if (!img.attr(INLINE_MODE_ATTR).isEmpty() && !img.attr(INLINE_... | java | public static boolean isInlineModeAllowed(Element img, InlineMode mode) {
// if already inlined => reject (do not inline twice)
if (!img.attr(INLINED_ATTR).isEmpty()) {
return false;
}
// if inline mode defined but not the wanted mode => reject
if (!img.attr(INLINE_MODE_ATTR).isEmpty() && !img.attr(INLINE_... | [
"public",
"static",
"boolean",
"isInlineModeAllowed",
"(",
"Element",
"img",
",",
"InlineMode",
"mode",
")",
"{",
"// if already inlined => reject (do not inline twice)",
"if",
"(",
"!",
"img",
".",
"attr",
"(",
"INLINED_ATTR",
")",
".",
"isEmpty",
"(",
")",
")",
... | Checks if inlining mode is allowed on the provided element.
@param img
the image element to check if the actual inlining mode is
allowed
@param mode
the actual mode
@return true if this mode is allowed, false otherwise | [
"Checks",
"if",
"inlining",
"mode",
"is",
"allowed",
"on",
"the",
"provided",
"element",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/html/inliner/impl/jsoup/ImageInlineUtils.java#L31-L43 | train |
groupe-sii/ogham | ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CharsetBuilder.java | CharsetBuilder.convert | public CharsetBuilder convert(String nioCharsetName, String cloudhopperCharset) {
mappings.add(new CharsetMapping(nioCharsetName, cloudhopperCharset));
return this;
} | java | public CharsetBuilder convert(String nioCharsetName, String cloudhopperCharset) {
mappings.add(new CharsetMapping(nioCharsetName, cloudhopperCharset));
return this;
} | [
"public",
"CharsetBuilder",
"convert",
"(",
"String",
"nioCharsetName",
",",
"String",
"cloudhopperCharset",
")",
"{",
"mappings",
".",
"add",
"(",
"new",
"CharsetMapping",
"(",
"nioCharsetName",
",",
"cloudhopperCharset",
")",
")",
";",
"return",
"this",
";",
"... | Registers a charset conversion. Conversion is required by Cloudhopper in
order to use a charset supported by the SMPP protocol.
You can register several charset conversions.
@param nioCharsetName
the charset used by the Java application
@param cloudhopperCharset
the charset supported by the SMPP protocol
@return this... | [
"Registers",
"a",
"charset",
"conversion",
".",
"Conversion",
"is",
"required",
"by",
"Cloudhopper",
"in",
"order",
"to",
"use",
"a",
"charset",
"supported",
"by",
"the",
"SMPP",
"protocol",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CharsetBuilder.java#L82-L85 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/resource/resolver/FirstSupportingResourceResolver.java | FirstSupportingResourceResolver.getSupportingResolver | @Override
public ResourceResolver getSupportingResolver(String path) {
LOG.debug("Finding resolver for resource {}...", path);
for (ResourceResolver resolver : resolvers) {
if (resolver.supports(path)) {
LOG.debug("{} can handle resource {}", resolver, path);
return resolver;
}
}
LOG.debug("No r... | java | @Override
public ResourceResolver getSupportingResolver(String path) {
LOG.debug("Finding resolver for resource {}...", path);
for (ResourceResolver resolver : resolvers) {
if (resolver.supports(path)) {
LOG.debug("{} can handle resource {}", resolver, path);
return resolver;
}
}
LOG.debug("No r... | [
"@",
"Override",
"public",
"ResourceResolver",
"getSupportingResolver",
"(",
"String",
"path",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Finding resolver for resource {}...\"",
",",
"path",
")",
";",
"for",
"(",
"ResourceResolver",
"resolver",
":",
"resolvers",
")",
... | Find the first supporting resolver.
@param path
the name of the path of the resource
@return the first resolver supporting the path | [
"Find",
"the",
"first",
"supporting",
"resolver",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/resource/resolver/FirstSupportingResourceResolver.java#L93-L105 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/resolution/ResourceResolutionBuilderHelper.java | ResourceResolutionBuilderHelper.buildResolvers | public List<ResourceResolver> buildResolvers() {
List<ResourceResolver> resolvers = new ArrayList<>();
resolvers.addAll(customResolvers);
// ensure that default lookup is always the last registered
List<ResolverHelper> helpers = new ArrayList<>();
if (classPath != null) {
helpers.add(new ResolverHelper(cla... | java | public List<ResourceResolver> buildResolvers() {
List<ResourceResolver> resolvers = new ArrayList<>();
resolvers.addAll(customResolvers);
// ensure that default lookup is always the last registered
List<ResolverHelper> helpers = new ArrayList<>();
if (classPath != null) {
helpers.add(new ResolverHelper(cla... | [
"public",
"List",
"<",
"ResourceResolver",
">",
"buildResolvers",
"(",
")",
"{",
"List",
"<",
"ResourceResolver",
">",
"resolvers",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"resolvers",
".",
"addAll",
"(",
"customResolvers",
")",
";",
"// ensure that defa... | Build the list of resource resolvers.
<p>
The list is ordered to ensure that empty string lookup is always the last
registered.
</p>
<p>
If some custom resolvers are registered, they are used before default
ones in the order they were registered.
</p>
@return the list of resource resolvers | [
"Build",
"the",
"list",
"of",
"resource",
"resolvers",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/resolution/ResourceResolutionBuilderHelper.java#L95-L114 | train |
groupe-sii/ogham | ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CloudhopperBuilder.java | CloudhopperBuilder.port | public CloudhopperBuilder port(String... port) {
for (String p : port) {
if (port != null) {
ports.add(p);
}
}
return this;
} | java | public CloudhopperBuilder port(String... port) {
for (String p : port) {
if (port != null) {
ports.add(p);
}
}
return this;
} | [
"public",
"CloudhopperBuilder",
"port",
"(",
"String",
"...",
"port",
")",
"{",
"for",
"(",
"String",
"p",
":",
"port",
")",
"{",
"if",
"(",
"port",
"!=",
"null",
")",
"{",
"ports",
".",
"add",
"(",
"p",
")",
";",
"}",
"}",
"return",
"this",
";",... | Set the SMPP server port.
You can specify a direct value. For example:
<pre>
.port("2775");
</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 evaluat... | [
"Set",
"the",
"SMPP",
"server",
"port",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CloudhopperBuilder.java#L434-L441 | train |
groupe-sii/ogham | ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CloudhopperBuilder.java | CloudhopperBuilder.interfaceVersion | public CloudhopperBuilder interfaceVersion(String... version) {
for (String v : version) {
if (v != null) {
interfaceVersions.add(v);
}
}
return this;
} | java | public CloudhopperBuilder interfaceVersion(String... version) {
for (String v : version) {
if (v != null) {
interfaceVersions.add(v);
}
}
return this;
} | [
"public",
"CloudhopperBuilder",
"interfaceVersion",
"(",
"String",
"...",
"version",
")",
"{",
"for",
"(",
"String",
"v",
":",
"version",
")",
"{",
"if",
"(",
"v",
"!=",
"null",
")",
"{",
"interfaceVersions",
".",
"add",
"(",
"v",
")",
";",
"}",
"}",
... | Set the SMPP protocol version.
You can specify a direct value. For example:
<pre>
.interfaceVersion("3.4");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.interfaceVersion("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immedi... | [
"Set",
"the",
"SMPP",
"protocol",
"version",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-cloudhopper/src/main/java/fr/sii/ogham/sms/builder/cloudhopper/CloudhopperBuilder.java#L524-L531 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapContentHandler.java | MapContentHandler.addContentHandler | public void addContentHandler(Class<? extends Content> clazz, JavaMailContentHandler handler) {
map.put(clazz, handler);
} | java | public void addContentHandler(Class<? extends Content> clazz, JavaMailContentHandler handler) {
map.put(clazz, handler);
} | [
"public",
"void",
"addContentHandler",
"(",
"Class",
"<",
"?",
"extends",
"Content",
">",
"clazz",
",",
"JavaMailContentHandler",
"handler",
")",
"{",
"map",
".",
"put",
"(",
"clazz",
",",
"handler",
")",
";",
"}"
] | Register a new content handler.
@param clazz
the class of the content
@param handler
the content handler | [
"Register",
"a",
"new",
"content",
"handler",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapContentHandler.java#L61-L63 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/MessagingBuilder.java | MessagingBuilder.configure | public void configure() {
Collections.sort(configurers, new PriorityComparator());
for (PrioritizedConfigurer configurer : configurers) {
configurer.getConfigurer().configure(this);
}
} | java | public void configure() {
Collections.sort(configurers, new PriorityComparator());
for (PrioritizedConfigurer configurer : configurers) {
configurer.getConfigurer().configure(this);
}
} | [
"public",
"void",
"configure",
"(",
")",
"{",
"Collections",
".",
"sort",
"(",
"configurers",
",",
"new",
"PriorityComparator",
"(",
")",
")",
";",
"for",
"(",
"PrioritizedConfigurer",
"configurer",
":",
"configurers",
")",
"{",
"configurer",
".",
"getConfigur... | Apply all registered configurers on this builder instance.
<p>
When using {@link #standard()} and {@link #minimal()} factory methods,
this method is automatically called. | [
"Apply",
"all",
"registered",
"configurers",
"on",
"this",
"builder",
"instance",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/MessagingBuilder.java#L294-L299 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/MessagingBuilder.java | MessagingBuilder.build | @Override
public MessagingService build() {
LOG.info("Using service that calls all registered senders");
List<ConditionalSender> senders = buildSenders();
LOG.debug("Registered senders: {}", senders);
MessagingService service = new EverySupportingMessagingService(senders);
if (wrapUncaught) {
service = ne... | java | @Override
public MessagingService build() {
LOG.info("Using service that calls all registered senders");
List<ConditionalSender> senders = buildSenders();
LOG.debug("Registered senders: {}", senders);
MessagingService service = new EverySupportingMessagingService(senders);
if (wrapUncaught) {
service = ne... | [
"@",
"Override",
"public",
"MessagingService",
"build",
"(",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Using service that calls all registered senders\"",
")",
";",
"List",
"<",
"ConditionalSender",
">",
"senders",
"=",
"buildSenders",
"(",
")",
";",
"LOG",
".",
"de... | Builds the messaging service. The messaging service relies on the
generated senders. Each sender is able to manage one or multiple
messages. The default implementation of the messaging service is to ask
each sender if it is able to handle the message and if it the case, then
use this sender to really send the message. ... | [
"Builds",
"the",
"messaging",
"service",
".",
"The",
"messaging",
"service",
"relies",
"on",
"the",
"generated",
"senders",
".",
"Each",
"sender",
"is",
"able",
"to",
"manage",
"one",
"or",
"multiple",
"messages",
".",
"The",
"default",
"implementation",
"of",... | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/MessagingBuilder.java#L1069-L1079 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapAttachmentResourceHandler.java | MapAttachmentResourceHandler.addResourceHandler | public void addResourceHandler(Class<? extends NamedResource> clazz, JavaMailAttachmentResourceHandler handler) {
map.put(clazz, handler);
} | java | public void addResourceHandler(Class<? extends NamedResource> clazz, JavaMailAttachmentResourceHandler handler) {
map.put(clazz, handler);
} | [
"public",
"void",
"addResourceHandler",
"(",
"Class",
"<",
"?",
"extends",
"NamedResource",
">",
"clazz",
",",
"JavaMailAttachmentResourceHandler",
"handler",
")",
"{",
"map",
".",
"put",
"(",
"clazz",
",",
"handler",
")",
";",
"}"
] | Register a new attachment resource handler.
@param clazz
the class of the attachment resource
@param handler
the attachment resource handler | [
"Register",
"a",
"new",
"attachment",
"resource",
"handler",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/javamail/MapAttachmentResourceHandler.java#L64-L66 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/util/classpath/SimpleClasspathHelper.java | SimpleClasspathHelper.exists | public boolean exists(String className) {
if(this.classLoader!=null) {
if(exists(className, this.classLoader)) {
LOG.debug("class {} found using class specific class loader", className);
return true;
}
return false;
}
if(existsWithDefaultClassLoader(className)) {
LOG.debug("class {} found usin... | java | public boolean exists(String className) {
if(this.classLoader!=null) {
if(exists(className, this.classLoader)) {
LOG.debug("class {} found using class specific class loader", className);
return true;
}
return false;
}
if(existsWithDefaultClassLoader(className)) {
LOG.debug("class {} found usin... | [
"public",
"boolean",
"exists",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"this",
".",
"classLoader",
"!=",
"null",
")",
"{",
"if",
"(",
"exists",
"(",
"className",
",",
"this",
".",
"classLoader",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"cl... | Test if the class name is defined in the classpath.
@param className
the class name
@return true if the class exists in the classpath, false otherwise | [
"Test",
"if",
"the",
"class",
"name",
"is",
"defined",
"in",
"the",
"classpath",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/classpath/SimpleClasspathHelper.java#L25-L46 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/util/EqualsBuilder.java | EqualsBuilder.append | public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) {
if (equals && !same) {
delegate.append(objectFieldValue, otherFieldValue);
}
return this;
} | java | public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) {
if (equals && !same) {
delegate.append(objectFieldValue, otherFieldValue);
}
return this;
} | [
"public",
"EqualsBuilder",
"append",
"(",
"Object",
"objectFieldValue",
",",
"Object",
"otherFieldValue",
")",
"{",
"if",
"(",
"equals",
"&&",
"!",
"same",
")",
"{",
"delegate",
".",
"append",
"(",
"objectFieldValue",
",",
"otherFieldValue",
")",
";",
"}",
"... | Test if two Objects are equal using their equals method.
@param objectFieldValue
the value of a field of the object
@param otherFieldValue
the value of a field of the other object
@return used to chain calls | [
"Test",
"if",
"two",
"Objects",
"are",
"equal",
"using",
"their",
"equals",
"method",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/EqualsBuilder.java#L145-L150 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/condition/fluent/FluentCondition.java | FluentCondition.and | @SafeVarargs
public final FluentCondition<T> and(Condition<T>... conditions) {
List<Condition<T>> merged = new ArrayList<>();
merged.add(delegate);
for (Condition<T> condition : conditions) {
merged.add(condition);
}
return Conditions.and(merged);
} | java | @SafeVarargs
public final FluentCondition<T> and(Condition<T>... conditions) {
List<Condition<T>> merged = new ArrayList<>();
merged.add(delegate);
for (Condition<T> condition : conditions) {
merged.add(condition);
}
return Conditions.and(merged);
} | [
"@",
"SafeVarargs",
"public",
"final",
"FluentCondition",
"<",
"T",
">",
"and",
"(",
"Condition",
"<",
"T",
">",
"...",
"conditions",
")",
"{",
"List",
"<",
"Condition",
"<",
"T",
">>",
"merged",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"merged",
... | Create a logical AND operator between current condition and conditions
provided in parameters.
For example:
<pre>
requiredClass("javax.mail.Transport").and(requiredClass("foo.Bar"));
</pre>
Means that the result will be true only if the result of the current
condition (<code>requiredClass("javax.mail.Transport")</co... | [
"Create",
"a",
"logical",
"AND",
"operator",
"between",
"current",
"condition",
"and",
"conditions",
"provided",
"in",
"parameters",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/condition/fluent/FluentCondition.java#L73-L81 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/RetryBuilder.java | RetryBuilder.fixedDelay | public FixedDelayBuilder<RetryBuilder<P>> fixedDelay() {
if (fixedDelay == null) {
fixedDelay = new FixedDelayBuilder<>(this, environmentBuilder);
}
return fixedDelay;
} | java | public FixedDelayBuilder<RetryBuilder<P>> fixedDelay() {
if (fixedDelay == null) {
fixedDelay = new FixedDelayBuilder<>(this, environmentBuilder);
}
return fixedDelay;
} | [
"public",
"FixedDelayBuilder",
"<",
"RetryBuilder",
"<",
"P",
">",
">",
"fixedDelay",
"(",
")",
"{",
"if",
"(",
"fixedDelay",
"==",
"null",
")",
"{",
"fixedDelay",
"=",
"new",
"FixedDelayBuilder",
"<>",
"(",
"this",
",",
"environmentBuilder",
")",
";",
"}"... | Retry several times with a fixed delay between each try until the maximum
attempts is reached.
For example:
<pre>
.fixedDelay()
.delay(500)
.maxRetries(5)
</pre>
Means that a retry will be attempted every 500ms until 5 attempts are
reached (inclusive). For example, you want to connect to an external
system at t1=0 a... | [
"Retry",
"several",
"times",
"with",
"a",
"fixed",
"delay",
"between",
"each",
"try",
"until",
"the",
"maximum",
"attempts",
"is",
"reached",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/RetryBuilder.java#L83-L88 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/UsernamePasswordAuthenticatorBuilder.java | UsernamePasswordAuthenticatorBuilder.username | public UsernamePasswordAuthenticatorBuilder username(String... username) {
for (String u : username) {
if (u != null && !u.isEmpty()) {
usernames.add(u);
}
}
return this;
} | java | public UsernamePasswordAuthenticatorBuilder username(String... username) {
for (String u : username) {
if (u != null && !u.isEmpty()) {
usernames.add(u);
}
}
return this;
} | [
"public",
"UsernamePasswordAuthenticatorBuilder",
"username",
"(",
"String",
"...",
"username",
")",
"{",
"for",
"(",
"String",
"u",
":",
"username",
")",
"{",
"if",
"(",
"u",
"!=",
"null",
"&&",
"!",
"u",
".",
"isEmpty",
"(",
")",
")",
"{",
"usernames",... | Set the username to use for the authentication.
You can specify a direct value. For example:
<pre>
.username("foo");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.username("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immed... | [
"Set",
"the",
"username",
"to",
"use",
"for",
"the",
"authentication",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/UsernamePasswordAuthenticatorBuilder.java#L93-L100 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/UsernamePasswordAuthenticatorBuilder.java | UsernamePasswordAuthenticatorBuilder.password | public UsernamePasswordAuthenticatorBuilder password(String... password) {
for (String p : password) {
if (p != null && !p.isEmpty()) {
passwords.add(p);
}
}
return this;
} | java | public UsernamePasswordAuthenticatorBuilder password(String... password) {
for (String p : password) {
if (p != null && !p.isEmpty()) {
passwords.add(p);
}
}
return this;
} | [
"public",
"UsernamePasswordAuthenticatorBuilder",
"password",
"(",
"String",
"...",
"password",
")",
"{",
"for",
"(",
"String",
"p",
":",
"password",
")",
"{",
"if",
"(",
"p",
"!=",
"null",
"&&",
"!",
"p",
".",
"isEmpty",
"(",
")",
")",
"{",
"passwords",... | Set the password to use for the authentication.
You can specify a direct value. For example:
<pre>
.password("foo");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.password("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immed... | [
"Set",
"the",
"password",
"to",
"use",
"for",
"the",
"authentication",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/builder/javamail/UsernamePasswordAuthenticatorBuilder.java#L130-L137 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/FixedDelayBuilder.java | FixedDelayBuilder.maxRetries | public FixedDelayBuilder<P> maxRetries(String... maxRetries) {
for (String m : maxRetries) {
if (m != null) {
maxRetriesProps.add(m);
}
}
return this;
} | java | public FixedDelayBuilder<P> maxRetries(String... maxRetries) {
for (String m : maxRetries) {
if (m != null) {
maxRetriesProps.add(m);
}
}
return this;
} | [
"public",
"FixedDelayBuilder",
"<",
"P",
">",
"maxRetries",
"(",
"String",
"...",
"maxRetries",
")",
"{",
"for",
"(",
"String",
"m",
":",
"maxRetries",
")",
"{",
"if",
"(",
"m",
"!=",
"null",
")",
"{",
"maxRetriesProps",
".",
"add",
"(",
"m",
")",
";... | Set the maximum number of attempts.
You can specify a direct value. For example:
<pre>
.maxRetries("10");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.delay("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immediately evaluat... | [
"Set",
"the",
"maximum",
"number",
"of",
"attempts",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/builder/retry/FixedDelayBuilder.java#L134-L141 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java | OvhSmsSender.handleResponse | private void handleResponse(Sms message, Response response) throws IOException, JsonProcessingException, MessageNotSentException {
if (response.getStatus().isSuccess()) {
JsonNode json = mapper.readTree(response.getBody());
int ovhStatus = json.get("status").asInt();
// 100 <= ovh status < 200 ====> OK -> ju... | java | private void handleResponse(Sms message, Response response) throws IOException, JsonProcessingException, MessageNotSentException {
if (response.getStatus().isSuccess()) {
JsonNode json = mapper.readTree(response.getBody());
int ovhStatus = json.get("status").asInt();
// 100 <= ovh status < 200 ====> OK -> ju... | [
"private",
"void",
"handleResponse",
"(",
"Sms",
"message",
",",
"Response",
"response",
")",
"throws",
"IOException",
",",
"JsonProcessingException",
",",
"MessageNotSentException",
"{",
"if",
"(",
"response",
".",
"getStatus",
"(",
")",
".",
"isSuccess",
"(",
... | Handle OVH response. If status provided in response is less than 200,
then the message has been sent. Otherwise, the message has not been sent.
@param message
the SMS to send
@param response
the received response from OVH API
@throws IOException
when the response couldn't be read
@throws JsonProcessingException
when t... | [
"Handle",
"OVH",
"response",
".",
"If",
"status",
"provided",
"in",
"response",
"is",
"less",
"than",
"200",
"then",
"the",
"message",
"has",
"been",
"sent",
".",
"Otherwise",
"the",
"message",
"has",
"not",
"been",
"sent",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java#L125-L147 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java | OvhSmsSender.convert | private static List<String> convert(List<Recipient> recipients) throws PhoneNumberException {
List<String> tos = new ArrayList<>(recipients.size());
// convert phone numbers to international format
for (Recipient recipient : recipients) {
tos.add(toInternational(recipient.getPhoneNumber()));
}
return tos;
... | java | private static List<String> convert(List<Recipient> recipients) throws PhoneNumberException {
List<String> tos = new ArrayList<>(recipients.size());
// convert phone numbers to international format
for (Recipient recipient : recipients) {
tos.add(toInternational(recipient.getPhoneNumber()));
}
return tos;
... | [
"private",
"static",
"List",
"<",
"String",
">",
"convert",
"(",
"List",
"<",
"Recipient",
">",
"recipients",
")",
"throws",
"PhoneNumberException",
"{",
"List",
"<",
"String",
">",
"tos",
"=",
"new",
"ArrayList",
"<>",
"(",
"recipients",
".",
"size",
"(",... | Convert the list of SMS recipients to international phone numbers usable
by OVH.
@param recipients
the list of recipients
@return the list of international phone numbers
@throws PhoneNumberException | [
"Convert",
"the",
"list",
"of",
"SMS",
"recipients",
"to",
"international",
"phone",
"numbers",
"usable",
"by",
"OVH",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/sender/impl/OvhSmsSender.java#L172-L179 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java | OvhSmsBuilder.url | public OvhSmsBuilder url(String... url) {
for (String u : url) {
if (u != null) {
urls.add(u);
}
}
return this;
} | java | public OvhSmsBuilder url(String... url) {
for (String u : url) {
if (u != null) {
urls.add(u);
}
}
return this;
} | [
"public",
"OvhSmsBuilder",
"url",
"(",
"String",
"...",
"url",
")",
"{",
"for",
"(",
"String",
"u",
":",
"url",
")",
"{",
"if",
"(",
"u",
"!=",
"null",
")",
"{",
"urls",
".",
"add",
"(",
"u",
")",
";",
"}",
"}",
"return",
"this",
";",
"}"
] | Set the URL of the OVH SMS HTTP API.
You can specify a direct value. For example:
<pre>
.url("https://www.ovh.com/cgi-bin/sms/http2sms.cgi");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.host("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The pro... | [
"Set",
"the",
"URL",
"of",
"the",
"OVH",
"SMS",
"HTTP",
"API",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java#L218-L225 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java | OvhSmsBuilder.account | public OvhSmsBuilder account(String... account) {
for (String a : account) {
if (a != null) {
accounts.add(a);
}
}
return this;
} | java | public OvhSmsBuilder account(String... account) {
for (String a : account) {
if (a != null) {
accounts.add(a);
}
}
return this;
} | [
"public",
"OvhSmsBuilder",
"account",
"(",
"String",
"...",
"account",
")",
"{",
"for",
"(",
"String",
"a",
":",
"account",
")",
"{",
"if",
"(",
"a",
"!=",
"null",
")",
"{",
"accounts",
".",
"add",
"(",
"a",
")",
";",
"}",
"}",
"return",
"this",
... | Set the OVH account identifier.
You can specify a direct value. For example:
<pre>
.account("foo");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.account("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immediately evaluated. ... | [
"Set",
"the",
"OVH",
"account",
"identifier",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java#L255-L262 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java | OvhSmsBuilder.login | public OvhSmsBuilder login(String... login) {
for (String l : login) {
if (l != null) {
logins.add(l);
}
}
return this;
} | java | public OvhSmsBuilder login(String... login) {
for (String l : login) {
if (l != null) {
logins.add(l);
}
}
return this;
} | [
"public",
"OvhSmsBuilder",
"login",
"(",
"String",
"...",
"login",
")",
"{",
"for",
"(",
"String",
"l",
":",
"login",
")",
"{",
"if",
"(",
"l",
"!=",
"null",
")",
"{",
"logins",
".",
"add",
"(",
"l",
")",
";",
"}",
"}",
"return",
"this",
";",
"... | Set the OVH username.
You can specify a direct value. For example:
<pre>
.login("foo");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.login("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immediately evaluated. The evaluation... | [
"Set",
"the",
"OVH",
"username",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java#L292-L299 | train |
groupe-sii/ogham | ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java | OvhSmsBuilder.password | public OvhSmsBuilder password(String... password) {
for (String p : password) {
if (p != null) {
passwords.add(p);
}
}
return this;
} | java | public OvhSmsBuilder password(String... password) {
for (String p : password) {
if (p != null) {
passwords.add(p);
}
}
return this;
} | [
"public",
"OvhSmsBuilder",
"password",
"(",
"String",
"...",
"password",
")",
"{",
"for",
"(",
"String",
"p",
":",
"password",
")",
"{",
"if",
"(",
"p",
"!=",
"null",
")",
"{",
"passwords",
".",
"add",
"(",
"p",
")",
";",
"}",
"}",
"return",
"this"... | Set the OVH password.
You can specify a direct value. For example:
<pre>
.password("bar");
</pre>
<p>
You can also specify one or several property keys. For example:
<pre>
.password("${custom.property.high-priority}", "${custom.property.low-priority}");
</pre>
The properties are not immediately evaluated. The eval... | [
"Set",
"the",
"OVH",
"password",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-sms-ovh/src/main/java/fr/sii/ogham/sms/builder/ovh/OvhSmsBuilder.java#L329-L336 | train |
groupe-sii/ogham | ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/MapContentHandler.java | MapContentHandler.register | public SendGridContentHandler register(final Class<? extends Content> clazz, final SendGridContentHandler handler) {
if (handler == null) {
throw new IllegalArgumentException("[handler] cannot be null");
}
if (clazz == null) {
throw new IllegalArgumentException("[clazz] cannot be null");
}
LOG.... | java | public SendGridContentHandler register(final Class<? extends Content> clazz, final SendGridContentHandler handler) {
if (handler == null) {
throw new IllegalArgumentException("[handler] cannot be null");
}
if (clazz == null) {
throw new IllegalArgumentException("[clazz] cannot be null");
}
LOG.... | [
"public",
"SendGridContentHandler",
"register",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Content",
">",
"clazz",
",",
"final",
"SendGridContentHandler",
"handler",
")",
"{",
"if",
"(",
"handler",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentExcept... | Registers a handler for a given content type.
@param clazz
the content type
@param handler
the handler
@return the handler formerly associated with the content type, if there
was one | [
"Registers",
"a",
"handler",
"for",
"a",
"given",
"content",
"type",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-sendgrid/src/main/java/fr/sii/ogham/email/sender/impl/sendgrid/handler/MapContentHandler.java#L43-L53 | train |
groupe-sii/ogham | ogham-template-freemarker/src/main/java/fr/sii/ogham/template/freemarker/builder/AbstractFreemarkerBuilder.java | AbstractFreemarkerBuilder.configuration | public FreemarkerConfigurationBuilder<MYSELF> configuration() {
if (configurationBuilder == null) {
configurationBuilder = new FreemarkerConfigurationBuilder<>(myself, environmentBuilder);
}
return configurationBuilder;
} | java | public FreemarkerConfigurationBuilder<MYSELF> configuration() {
if (configurationBuilder == null) {
configurationBuilder = new FreemarkerConfigurationBuilder<>(myself, environmentBuilder);
}
return configurationBuilder;
} | [
"public",
"FreemarkerConfigurationBuilder",
"<",
"MYSELF",
">",
"configuration",
"(",
")",
"{",
"if",
"(",
"configurationBuilder",
"==",
"null",
")",
"{",
"configurationBuilder",
"=",
"new",
"FreemarkerConfigurationBuilder",
"<>",
"(",
"myself",
",",
"environmentBuild... | Fluent configurer for Freemarker configuration.
@return the fluent builder for Freemarker configuration object | [
"Fluent",
"configurer",
"for",
"Freemarker",
"configuration",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-template-freemarker/src/main/java/fr/sii/ogham/template/freemarker/builder/AbstractFreemarkerBuilder.java#L203-L208 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.createMimeMessage | private MimeMessage createMimeMessage() {
// prepare the message
Session session = Session.getInstance(properties, authenticator);
return new MimeMessage(session);
} | java | private MimeMessage createMimeMessage() {
// prepare the message
Session session = Session.getInstance(properties, authenticator);
return new MimeMessage(session);
} | [
"private",
"MimeMessage",
"createMimeMessage",
"(",
")",
"{",
"// prepare the message",
"Session",
"session",
"=",
"Session",
".",
"getInstance",
"(",
"properties",
",",
"authenticator",
")",
";",
"return",
"new",
"MimeMessage",
"(",
"session",
")",
";",
"}"
] | Initialize the session and create the mime message.
@return the mime message | [
"Initialize",
"the",
"session",
"and",
"create",
"the",
"mime",
"message",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L124-L128 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.setFrom | private void setFrom(Email email, MimeMessage mimeMsg) throws MessagingException, AddressException, UnsupportedEncodingException {
if (email.getFrom() == null) {
throw new IllegalArgumentException("The sender address has not been set");
}
mimeMsg.setFrom(toInternetAddress(email.getFrom()));
} | java | private void setFrom(Email email, MimeMessage mimeMsg) throws MessagingException, AddressException, UnsupportedEncodingException {
if (email.getFrom() == null) {
throw new IllegalArgumentException("The sender address has not been set");
}
mimeMsg.setFrom(toInternetAddress(email.getFrom()));
} | [
"private",
"void",
"setFrom",
"(",
"Email",
"email",
",",
"MimeMessage",
"mimeMsg",
")",
"throws",
"MessagingException",
",",
"AddressException",
",",
"UnsupportedEncodingException",
"{",
"if",
"(",
"email",
".",
"getFrom",
"(",
")",
"==",
"null",
")",
"{",
"t... | Set the sender address on the mime message.
@param email
the source email
@param mimeMsg
the mime message to fill
@throws MessagingException
when the email address is not valid
@throws AddressException
when the email address is not valid
@throws UnsupportedEncodingException
when the email address is not valid | [
"Set",
"the",
"sender",
"address",
"on",
"the",
"mime",
"message",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L144-L149 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.setRecipients | private void setRecipients(Email email, MimeMessage mimeMsg) throws MessagingException, AddressException, UnsupportedEncodingException {
for (Recipient recipient : email.getRecipients()) {
mimeMsg.addRecipient(convert(recipient.getType()), toInternetAddress(recipient.getAddress()));
}
} | java | private void setRecipients(Email email, MimeMessage mimeMsg) throws MessagingException, AddressException, UnsupportedEncodingException {
for (Recipient recipient : email.getRecipients()) {
mimeMsg.addRecipient(convert(recipient.getType()), toInternetAddress(recipient.getAddress()));
}
} | [
"private",
"void",
"setRecipients",
"(",
"Email",
"email",
",",
"MimeMessage",
"mimeMsg",
")",
"throws",
"MessagingException",
",",
"AddressException",
",",
"UnsupportedEncodingException",
"{",
"for",
"(",
"Recipient",
"recipient",
":",
"email",
".",
"getRecipients",
... | Set the recipients addresses on the mime message.
@param email
the source email
@param mimeMsg
the mime message to fill
@throws MessagingException
when the email address is not valid
@throws AddressException
when the email address is not valid
@throws UnsupportedEncodingException
when the email address is not valid | [
"Set",
"the",
"recipients",
"addresses",
"on",
"the",
"mime",
"message",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L165-L169 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.setMimeContent | private void setMimeContent(Email email, MimeMessage mimeMsg) throws MessagingException, ContentHandlerException, AttachmentResourceHandlerException {
LOG.debug("Add message content for email {}", email);
// create the root as mixed
MimeMultipart rootContainer = new MimeMultipart("mixed");
// create the contain... | java | private void setMimeContent(Email email, MimeMessage mimeMsg) throws MessagingException, ContentHandlerException, AttachmentResourceHandlerException {
LOG.debug("Add message content for email {}", email);
// create the root as mixed
MimeMultipart rootContainer = new MimeMultipart("mixed");
// create the contain... | [
"private",
"void",
"setMimeContent",
"(",
"Email",
"email",
",",
"MimeMessage",
"mimeMsg",
")",
"throws",
"MessagingException",
",",
"ContentHandlerException",
",",
"AttachmentResourceHandlerException",
"{",
"LOG",
".",
"debug",
"(",
"\"Add message content for email {}\"",
... | Set the content on the mime message.
<p>
If the source email has several contents (for example text and html) and
attachments (with attachment content disposition), the mime message looks
like:
<pre>
mixed
related
alternative
[text/plain] text message
[text/html] html message
attachment 1
attachment 2
</pre>
<p>
If ... | [
"Set",
"the",
"content",
"on",
"the",
"mime",
"message",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L232-L266 | train |
groupe-sii/ogham | ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java | JavaMailSender.addAttachment | private void addAttachment(Multipart multipart, Attachment attachment) throws AttachmentResourceHandlerException {
MimeBodyPart part = new MimeBodyPart();
try {
part.setFileName(attachment.getResource().getName());
part.setDisposition(attachment.getDisposition());
part.setDescription(attachment.getDescript... | java | private void addAttachment(Multipart multipart, Attachment attachment) throws AttachmentResourceHandlerException {
MimeBodyPart part = new MimeBodyPart();
try {
part.setFileName(attachment.getResource().getName());
part.setDisposition(attachment.getDisposition());
part.setDescription(attachment.getDescript... | [
"private",
"void",
"addAttachment",
"(",
"Multipart",
"multipart",
",",
"Attachment",
"attachment",
")",
"throws",
"AttachmentResourceHandlerException",
"{",
"MimeBodyPart",
"part",
"=",
"new",
"MimeBodyPart",
"(",
")",
";",
"try",
"{",
"part",
".",
"setFileName",
... | Add an attachment on the mime message.
@param multipart
the mime message to fill
@param attachment
the attachment to add
@throws AttachmentResourceHandlerException
when the attachment couldn't be attached | [
"Add",
"an",
"attachment",
"on",
"the",
"mime",
"message",
"."
] | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-email-javamail/src/main/java/fr/sii/ogham/email/sender/impl/JavaMailSender.java#L278-L290 | train |
groupe-sii/ogham | ogham-core/src/main/java/fr/sii/ogham/core/sender/MultiImplementationSender.java | MultiImplementationSender.addImplementation | public final MultiImplementationSender<M> addImplementation(Condition<Message> condition, MessageSender implementation) {
implementations.add(new Implementation(condition, implementation));
return this;
} | java | public final MultiImplementationSender<M> addImplementation(Condition<Message> condition, MessageSender implementation) {
implementations.add(new Implementation(condition, implementation));
return this;
} | [
"public",
"final",
"MultiImplementationSender",
"<",
"M",
">",
"addImplementation",
"(",
"Condition",
"<",
"Message",
">",
"condition",
",",
"MessageSender",
"implementation",
")",
"{",
"implementations",
".",
"add",
"(",
"new",
"Implementation",
"(",
"condition",
... | Register a new possible implementation with the associated condition. The
implementation is added at the end so any other possible implementation
will be used before this one if the associated condition allow it.
@param condition
the condition that indicates if the implementation can be used
at runtime
@param implemen... | [
"Register",
"a",
"new",
"possible",
"implementation",
"with",
"the",
"associated",
"condition",
".",
"The",
"implementation",
"is",
"added",
"at",
"the",
"end",
"so",
"any",
"other",
"possible",
"implementation",
"will",
"be",
"used",
"before",
"this",
"one",
... | e273b845604add74b5a25dfd931cb3c166b1008f | https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/sender/MultiImplementationSender.java#L90-L93 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 <BODY page attributes>. | [
"Write",
"HTML",
"page",
"body",
"tag",
".",
"Write",
"tags",
"<BODY",
"page",
"attributes>",
"."
] | a9252e62246ac33d55d51b993ba1159404e7d389 | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/html/Page.java#L216-L224 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
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 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.