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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/LinkedMultiValueMap.java | LinkedMultiValueMap.deepCopy | public LinkedMultiValueMap<K, V> deepCopy() {
LinkedMultiValueMap<K, V> copy = new LinkedMultiValueMap<>(this.size());
this.forEach((key, value) -> copy.put(key, new LinkedList<>(value)));
return copy;
} | java | public LinkedMultiValueMap<K, V> deepCopy() {
LinkedMultiValueMap<K, V> copy = new LinkedMultiValueMap<>(this.size());
this.forEach((key, value) -> copy.put(key, new LinkedList<>(value)));
return copy;
} | [
"public",
"LinkedMultiValueMap",
"<",
"K",
",",
"V",
">",
"deepCopy",
"(",
")",
"{",
"LinkedMultiValueMap",
"<",
"K",
",",
"V",
">",
"copy",
"=",
"new",
"LinkedMultiValueMap",
"<>",
"(",
"this",
".",
"size",
"(",
")",
")",
";",
"this",
".",
"forEach",
... | Create a deep copy of this Map.
@return a copy of this Map, including a copy of each value-holding List entry
@see #clone() | [
"Create",
"a",
"deep",
"copy",
"of",
"this",
"Map",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/LinkedMultiValueMap.java#L126-L130 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.executeAdvice | protected void executeAdvice(Executable action) {
if (log.isDebugEnabled()) {
log.debug("Action " + action);
}
try {
action.execute(this);
} catch (Exception e) {
setRaisedException(e);
throw new ActionExecutionException("Failed to execute... | java | protected void executeAdvice(Executable action) {
if (log.isDebugEnabled()) {
log.debug("Action " + action);
}
try {
action.execute(this);
} catch (Exception e) {
setRaisedException(e);
throw new ActionExecutionException("Failed to execute... | [
"protected",
"void",
"executeAdvice",
"(",
"Executable",
"action",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Action \"",
"+",
"action",
")",
";",
"}",
"try",
"{",
"action",
".",
"execute",
"(",
... | Executes advice action.
@param action the executable action | [
"Executes",
"advice",
"action",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L240-L251 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.getAspectAdviceBean | @SuppressWarnings("unchecked")
public <T> T getAspectAdviceBean(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAspectAdviceBean(aspectId) : null);
} | java | @SuppressWarnings("unchecked")
public <T> T getAspectAdviceBean(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAspectAdviceBean(aspectId) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getAspectAdviceBean",
"(",
"String",
"aspectId",
")",
"{",
"return",
"(",
"aspectAdviceResult",
"!=",
"null",
"?",
"(",
"T",
")",
"aspectAdviceResult",
".",
"getAspectAdviceBean",... | Gets the aspect advice bean.
@param <T> the generic type
@param aspectId the aspect id
@return the aspect advice bean | [
"Gets",
"the",
"aspect",
"advice",
"bean",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L450-L453 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.putAspectAdviceBean | protected void putAspectAdviceBean(String aspectId, Object adviceBean) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAspectAdviceBean(aspectId, adviceBean);
} | java | protected void putAspectAdviceBean(String aspectId, Object adviceBean) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAspectAdviceBean(aspectId, adviceBean);
} | [
"protected",
"void",
"putAspectAdviceBean",
"(",
"String",
"aspectId",
",",
"Object",
"adviceBean",
")",
"{",
"if",
"(",
"aspectAdviceResult",
"==",
"null",
")",
"{",
"aspectAdviceResult",
"=",
"new",
"AspectAdviceResult",
"(",
")",
";",
"}",
"aspectAdviceResult",... | Puts the aspect advice bean.
@param aspectId the aspect id
@param adviceBean the advice bean | [
"Puts",
"the",
"aspect",
"advice",
"bean",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L461-L466 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.getBeforeAdviceResult | @SuppressWarnings("unchecked")
public <T> T getBeforeAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getBeforeAdviceResult(aspectId) : null);
} | java | @SuppressWarnings("unchecked")
public <T> T getBeforeAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getBeforeAdviceResult(aspectId) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getBeforeAdviceResult",
"(",
"String",
"aspectId",
")",
"{",
"return",
"(",
"aspectAdviceResult",
"!=",
"null",
"?",
"(",
"T",
")",
"aspectAdviceResult",
".",
"getBeforeAdviceResu... | Gets the before advice result.
@param <T> the generic type
@param aspectId the aspect id
@return the before advice result | [
"Gets",
"the",
"before",
"advice",
"result",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L475-L478 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.getAfterAdviceResult | @SuppressWarnings("unchecked")
public <T> T getAfterAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAfterAdviceResult(aspectId) : null);
} | java | @SuppressWarnings("unchecked")
public <T> T getAfterAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAfterAdviceResult(aspectId) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getAfterAdviceResult",
"(",
"String",
"aspectId",
")",
"{",
"return",
"(",
"aspectAdviceResult",
"!=",
"null",
"?",
"(",
"T",
")",
"aspectAdviceResult",
".",
"getAfterAdviceResult... | Gets the after advice result.
@param <T> the generic type
@param aspectId the aspect id
@return the after advice result | [
"Gets",
"the",
"after",
"advice",
"result",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L487-L490 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.getAroundAdviceResult | @SuppressWarnings("unchecked")
public <T> T getAroundAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAroundAdviceResult(aspectId) : null);
} | java | @SuppressWarnings("unchecked")
public <T> T getAroundAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getAroundAdviceResult(aspectId) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getAroundAdviceResult",
"(",
"String",
"aspectId",
")",
"{",
"return",
"(",
"aspectAdviceResult",
"!=",
"null",
"?",
"(",
"T",
")",
"aspectAdviceResult",
".",
"getAroundAdviceResu... | Gets the around advice result.
@param <T> the generic type
@param aspectId the aspect id
@return the around advice result | [
"Gets",
"the",
"around",
"advice",
"result",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L499-L502 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.getFinallyAdviceResult | @SuppressWarnings("unchecked")
public <T> T getFinallyAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getFinallyAdviceResult(aspectId) : null);
} | java | @SuppressWarnings("unchecked")
public <T> T getFinallyAdviceResult(String aspectId) {
return (aspectAdviceResult != null ? (T)aspectAdviceResult.getFinallyAdviceResult(aspectId) : null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getFinallyAdviceResult",
"(",
"String",
"aspectId",
")",
"{",
"return",
"(",
"aspectAdviceResult",
"!=",
"null",
"?",
"(",
"T",
")",
"aspectAdviceResult",
".",
"getFinallyAdviceRe... | Gets the finally advice result.
@param <T> the generic type
@param aspectId the aspect id
@return the finally advice result | [
"Gets",
"the",
"finally",
"advice",
"result",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L511-L514 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.putAdviceResult | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAdviceResult(aspectAdviceRule, adviceActionResult);
} | java | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAdviceResult(aspectAdviceRule, adviceActionResult);
} | [
"protected",
"void",
"putAdviceResult",
"(",
"AspectAdviceRule",
"aspectAdviceRule",
",",
"Object",
"adviceActionResult",
")",
"{",
"if",
"(",
"aspectAdviceResult",
"==",
"null",
")",
"{",
"aspectAdviceResult",
"=",
"new",
"AspectAdviceResult",
"(",
")",
";",
"}",
... | Puts the result of the advice.
@param aspectAdviceRule the aspect advice rule
@param adviceActionResult the advice action result | [
"Puts",
"the",
"result",
"of",
"the",
"advice",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L522-L527 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/TransletRule.java | TransletRule.touchActionList | private ActionList touchActionList() {
if (contentList != null) {
if (contentList.isExplicit() || contentList.size() != 1) {
contentList = null;
} else {
ActionList actionList = contentList.get(0);
if (actionList.isExplicit()) {
... | java | private ActionList touchActionList() {
if (contentList != null) {
if (contentList.isExplicit() || contentList.size() != 1) {
contentList = null;
} else {
ActionList actionList = contentList.get(0);
if (actionList.isExplicit()) {
... | [
"private",
"ActionList",
"touchActionList",
"(",
")",
"{",
"if",
"(",
"contentList",
"!=",
"null",
")",
"{",
"if",
"(",
"contentList",
".",
"isExplicit",
"(",
")",
"||",
"contentList",
".",
"size",
"(",
")",
"!=",
"1",
")",
"{",
"contentList",
"=",
"nu... | Returns the action list.
If not yet instantiated then create a new one.
@return the action list | [
"Returns",
"the",
"action",
"list",
".",
"If",
"not",
"yet",
"instantiated",
"then",
"create",
"a",
"new",
"one",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/TransletRule.java#L302-L322 | train |
aspectran/aspectran | web/src/main/java/com/aspectran/web/support/http/HttpStatusSetter.java | HttpStatusSetter.setStatus | public static void setStatus(HttpStatus httpStatus, Translet translet) {
translet.getResponseAdapter().setStatus(httpStatus.value());
} | java | public static void setStatus(HttpStatus httpStatus, Translet translet) {
translet.getResponseAdapter().setStatus(httpStatus.value());
} | [
"public",
"static",
"void",
"setStatus",
"(",
"HttpStatus",
"httpStatus",
",",
"Translet",
"translet",
")",
"{",
"translet",
".",
"getResponseAdapter",
"(",
")",
".",
"setStatus",
"(",
"httpStatus",
".",
"value",
"(",
")",
")",
";",
"}"
] | Sets the status code.
@param httpStatus the http status code
@param translet the Translet instance | [
"Sets",
"the",
"status",
"code",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/support/http/HttpStatusSetter.java#L31-L33 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/response/transform/xml/ContentsXMLReader.java | ContentsXMLReader.outputString | private void outputString(String s) throws SAXException {
handler.characters(s.toCharArray(), 0, s.length());
} | java | private void outputString(String s) throws SAXException {
handler.characters(s.toCharArray(), 0, s.length());
} | [
"private",
"void",
"outputString",
"(",
"String",
"s",
")",
"throws",
"SAXException",
"{",
"handler",
".",
"characters",
"(",
"s",
".",
"toCharArray",
"(",
")",
",",
"0",
",",
"s",
".",
"length",
"(",
")",
")",
";",
"}"
] | Outputs a string.
@param s the input string
@throws SAXException the SAX exception | [
"Outputs",
"a",
"string",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/response/transform/xml/ContentsXMLReader.java#L267-L269 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/response/transform/TransformResponse.java | TransformResponse.getTemplateAsStream | protected InputStream getTemplateAsStream(URL url) throws IOException {
URLConnection conn = url.openConnection();
return conn.getInputStream();
} | java | protected InputStream getTemplateAsStream(URL url) throws IOException {
URLConnection conn = url.openConnection();
return conn.getInputStream();
} | [
"protected",
"InputStream",
"getTemplateAsStream",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"URLConnection",
"conn",
"=",
"url",
".",
"openConnection",
"(",
")",
";",
"return",
"conn",
".",
"getInputStream",
"(",
")",
";",
"}"
] | Gets the template as stream.
@param url the url of the template
@return the input stream of the template
@throws IOException if an I/O error has occurred | [
"Gets",
"the",
"template",
"as",
"stream",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/response/transform/TransformResponse.java#L87-L90 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.search | public static int search(String str, String keyw) {
int strLen = str.length();
int keywLen = keyw.length();
int pos = 0;
int cnt = 0;
if (keywLen == 0) {
return 0;
}
while ((pos = str.indexOf(keyw, pos)) != -1) {
pos += keywLen;
... | java | public static int search(String str, String keyw) {
int strLen = str.length();
int keywLen = keyw.length();
int pos = 0;
int cnt = 0;
if (keywLen == 0) {
return 0;
}
while ((pos = str.indexOf(keyw, pos)) != -1) {
pos += keywLen;
... | [
"public",
"static",
"int",
"search",
"(",
"String",
"str",
",",
"String",
"keyw",
")",
"{",
"int",
"strLen",
"=",
"str",
".",
"length",
"(",
")",
";",
"int",
"keywLen",
"=",
"keyw",
".",
"length",
"(",
")",
";",
"int",
"pos",
"=",
"0",
";",
"int"... | Returns the number of times the specified string was found
in the target string, or 0 if there is no specified string.
@param str the target string
@param keyw the string to find
@return the number of times the specified string was found | [
"Returns",
"the",
"number",
"of",
"times",
"the",
"specified",
"string",
"was",
"found",
"in",
"the",
"target",
"string",
"or",
"0",
"if",
"there",
"is",
"no",
"specified",
"string",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L533-L549 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.searchIgnoreCase | public static int searchIgnoreCase(String str, String keyw) {
return search(str.toLowerCase(), keyw.toLowerCase());
} | java | public static int searchIgnoreCase(String str, String keyw) {
return search(str.toLowerCase(), keyw.toLowerCase());
} | [
"public",
"static",
"int",
"searchIgnoreCase",
"(",
"String",
"str",
",",
"String",
"keyw",
")",
"{",
"return",
"search",
"(",
"str",
".",
"toLowerCase",
"(",
")",
",",
"keyw",
".",
"toLowerCase",
"(",
")",
")",
";",
"}"
] | Returns the number of times the specified string was found
in the target string, or 0 if there is no specified string.
When searching for the specified string, it is not case-sensitive.
@param str the target string
@param keyw the string to find
@return the number of times the specified string was found | [
"Returns",
"the",
"number",
"of",
"times",
"the",
"specified",
"string",
"was",
"found",
"in",
"the",
"target",
"string",
"or",
"0",
"if",
"there",
"is",
"no",
"specified",
"string",
".",
"When",
"searching",
"for",
"the",
"specified",
"string",
"it",
"is"... | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L560-L562 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.search | public static int search(CharSequence chars, char c) {
int count = 0;
for (int i = 0; i < chars.length(); i++) {
if (chars.charAt(i) == c) {
count++;
}
}
return count;
} | java | public static int search(CharSequence chars, char c) {
int count = 0;
for (int i = 0; i < chars.length(); i++) {
if (chars.charAt(i) == c) {
count++;
}
}
return count;
} | [
"public",
"static",
"int",
"search",
"(",
"CharSequence",
"chars",
",",
"char",
"c",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"chars",
".",
"length",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"... | Returns the number of times the specified character was found
in the target string, or 0 if there is no specified character.
@param chars the target string
@param c the character to find
@return the number of times the specified character was found | [
"Returns",
"the",
"number",
"of",
"times",
"the",
"specified",
"character",
"was",
"found",
"in",
"the",
"target",
"string",
"or",
"0",
"if",
"there",
"is",
"no",
"specified",
"character",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L572-L580 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.searchIgnoreCase | public static int searchIgnoreCase(CharSequence chars, char c) {
int count = 0;
char cl = Character.toLowerCase(c);
for (int i = 0; i < chars.length(); i++) {
if (Character.toLowerCase(chars.charAt(i)) == cl) {
count++;
}
}
return count;
... | java | public static int searchIgnoreCase(CharSequence chars, char c) {
int count = 0;
char cl = Character.toLowerCase(c);
for (int i = 0; i < chars.length(); i++) {
if (Character.toLowerCase(chars.charAt(i)) == cl) {
count++;
}
}
return count;
... | [
"public",
"static",
"int",
"searchIgnoreCase",
"(",
"CharSequence",
"chars",
",",
"char",
"c",
")",
"{",
"int",
"count",
"=",
"0",
";",
"char",
"cl",
"=",
"Character",
".",
"toLowerCase",
"(",
"c",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"... | Returns the number of times the specified character was found
in the target string, or 0 if there is no specified character.
When searching for the specified character, it is not case-sensitive.
@param chars the target string
@param c the character to find
@return the number of times the specified character was found | [
"Returns",
"the",
"number",
"of",
"times",
"the",
"specified",
"character",
"was",
"found",
"in",
"the",
"target",
"string",
"or",
"0",
"if",
"there",
"is",
"no",
"specified",
"character",
".",
"When",
"searching",
"for",
"the",
"specified",
"character",
"it... | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L591-L600 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.toLanguageTag | public static String toLanguageTag(Locale locale) {
return locale.getLanguage() + (hasText(locale.getCountry()) ? "-" + locale.getCountry() : EMPTY);
} | java | public static String toLanguageTag(Locale locale) {
return locale.getLanguage() + (hasText(locale.getCountry()) ? "-" + locale.getCountry() : EMPTY);
} | [
"public",
"static",
"String",
"toLanguageTag",
"(",
"Locale",
"locale",
")",
"{",
"return",
"locale",
".",
"getLanguage",
"(",
")",
"+",
"(",
"hasText",
"(",
"locale",
".",
"getCountry",
"(",
")",
")",
"?",
"\"-\"",
"+",
"locale",
".",
"getCountry",
"(",... | Determine the RFC 3066 compliant language tag,
as used for the HTTP "Accept-Language" header.
@param locale the Locale to transform to a language tag
@return the RFC 3066 compliant language tag as {@code String} | [
"Determine",
"the",
"RFC",
"3066",
"compliant",
"language",
"tag",
"as",
"used",
"for",
"the",
"HTTP",
"Accept",
"-",
"Language",
"header",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L783-L785 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.convertToHumanFriendlyByteSize | public static String convertToHumanFriendlyByteSize(long size) {
if (size < 1024) {
return size + " B";
}
int z = (63 - Long.numberOfLeadingZeros(size)) / 10;
double d = (double)size / (1L << (z * 10));
String format = (d % 1.0 == 0) ? "%.0f %sB" : "%.1f %sB";
... | java | public static String convertToHumanFriendlyByteSize(long size) {
if (size < 1024) {
return size + " B";
}
int z = (63 - Long.numberOfLeadingZeros(size)) / 10;
double d = (double)size / (1L << (z * 10));
String format = (d % 1.0 == 0) ? "%.0f %sB" : "%.1f %sB";
... | [
"public",
"static",
"String",
"convertToHumanFriendlyByteSize",
"(",
"long",
"size",
")",
"{",
"if",
"(",
"size",
"<",
"1024",
")",
"{",
"return",
"size",
"+",
"\" B\"",
";",
"}",
"int",
"z",
"=",
"(",
"63",
"-",
"Long",
".",
"numberOfLeadingZeros",
"(",... | Convert byte size into human friendly format.
@param size the number of bytes
@return a human friendly byte size (includes units) | [
"Convert",
"byte",
"size",
"into",
"human",
"friendly",
"format",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L809-L817 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/StringUtils.java | StringUtils.convertToMachineFriendlyByteSize | @SuppressWarnings("fallthrough")
public static long convertToMachineFriendlyByteSize(String size) {
double d;
try {
d = Double.parseDouble(size.replaceAll("[GMK]?[B]?$", ""));
} catch (NumberFormatException e) {
String msg = "Size must be specified as bytes (B), " +
... | java | @SuppressWarnings("fallthrough")
public static long convertToMachineFriendlyByteSize(String size) {
double d;
try {
d = Double.parseDouble(size.replaceAll("[GMK]?[B]?$", ""));
} catch (NumberFormatException e) {
String msg = "Size must be specified as bytes (B), " +
... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"public",
"static",
"long",
"convertToMachineFriendlyByteSize",
"(",
"String",
"size",
")",
"{",
"double",
"d",
";",
"try",
"{",
"d",
"=",
"Double",
".",
"parseDouble",
"(",
"size",
".",
"replaceAll",
"(",
... | Convert byte size into machine friendly format.
@param size the human friendly byte size (includes units)
@return a number of bytes
@throws NumberFormatException if failed parse given size | [
"Convert",
"byte",
"size",
"into",
"machine",
"friendly",
"format",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/StringUtils.java#L826-L845 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ClassScanner.java | ClassScanner.scan | private void scan(final String targetPath, final String basePackageName, final String relativePackageName,
final WildcardMatcher matcher, final SaveHandler saveHandler) {
final File target = new File(targetPath);
if (!target.exists()) {
return;
}
target... | java | private void scan(final String targetPath, final String basePackageName, final String relativePackageName,
final WildcardMatcher matcher, final SaveHandler saveHandler) {
final File target = new File(targetPath);
if (!target.exists()) {
return;
}
target... | [
"private",
"void",
"scan",
"(",
"final",
"String",
"targetPath",
",",
"final",
"String",
"basePackageName",
",",
"final",
"String",
"relativePackageName",
",",
"final",
"WildcardMatcher",
"matcher",
",",
"final",
"SaveHandler",
"saveHandler",
")",
"{",
"final",
"F... | Recursive method used to find all classes in a given directory and sub dirs.
@param targetPath the target path
@param basePackageName the base package name
@param relativePackageName the relative package name
@param matcher the matcher
@param saveHandler the save handler | [
"Recursive",
"method",
"used",
"to",
"find",
"all",
"classes",
"in",
"a",
"given",
"directory",
"and",
"sub",
"dirs",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ClassScanner.java#L139-L175 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/TypeUtils.java | TypeUtils.isAssignableValue | public static boolean isAssignableValue(Class<?> type, Object value) {
if (value == null) {
return !type.isPrimitive();
}
Class<?> valueType = value.getClass();
if (type.isArray() || valueType.isArray()) {
if ((type.isArray() && valueType.isArray())) {
... | java | public static boolean isAssignableValue(Class<?> type, Object value) {
if (value == null) {
return !type.isPrimitive();
}
Class<?> valueType = value.getClass();
if (type.isArray() || valueType.isArray()) {
if ((type.isArray() && valueType.isArray())) {
... | [
"public",
"static",
"boolean",
"isAssignableValue",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"!",
"type",
".",
"isPrimitive",
"(",
")",
";",
"}",
"Class",
"<",
"?",
... | Determine if the given type is assignable from the given value,
assuming setting by reflection. Considers primitive wrapper classes
as assignable to the corresponding primitive types.
@param type the target type
@param value the value that should be assigned to the type
@return if the type is assignable from the va... | [
"Determine",
"if",
"the",
"given",
"type",
"is",
"assignable",
"from",
"the",
"given",
"value",
"assuming",
"setting",
"by",
"reflection",
".",
"Considers",
"primitive",
"wrapper",
"classes",
"as",
"assignable",
"to",
"the",
"corresponding",
"primitive",
"types",
... | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/TypeUtils.java#L136-L163 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/ReflectionUtils.java | ReflectionUtils.toComponentTypeArray | public static Object toComponentTypeArray(Object val, Class<?> componentType) {
if (val != null) {
int len = Array.getLength(val);
Object arr = Array.newInstance(componentType, len);
for (int i = 0; i < len; i++) {
Array.set(arr, i, Array.get(val, i));
... | java | public static Object toComponentTypeArray(Object val, Class<?> componentType) {
if (val != null) {
int len = Array.getLength(val);
Object arr = Array.newInstance(componentType, len);
for (int i = 0; i < len; i++) {
Array.set(arr, i, Array.get(val, i));
... | [
"public",
"static",
"Object",
"toComponentTypeArray",
"(",
"Object",
"val",
",",
"Class",
"<",
"?",
">",
"componentType",
")",
"{",
"if",
"(",
"val",
"!=",
"null",
")",
"{",
"int",
"len",
"=",
"Array",
".",
"getLength",
"(",
"val",
")",
";",
"Object",
... | Converts an array of objects to an array of the specified component type.
@param val an array of objects to be converted
@param componentType the {@code Class} object representing the component type of the new array
@return an array of the objects with the specified component type | [
"Converts",
"an",
"array",
"of",
"objects",
"to",
"an",
"array",
"of",
"the",
"specified",
"component",
"type",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/ReflectionUtils.java#L275-L286 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/process/result/ContentResult.java | ContentResult.addActionResult | public void addActionResult(ActionResult actionResult) {
ActionResult existActionResult = getActionResult(actionResult.getActionId());
if (existActionResult != null &&
existActionResult.getResultValue() instanceof ResultValueMap &&
actionResult.getResultValue() instanceof... | java | public void addActionResult(ActionResult actionResult) {
ActionResult existActionResult = getActionResult(actionResult.getActionId());
if (existActionResult != null &&
existActionResult.getResultValue() instanceof ResultValueMap &&
actionResult.getResultValue() instanceof... | [
"public",
"void",
"addActionResult",
"(",
"ActionResult",
"actionResult",
")",
"{",
"ActionResult",
"existActionResult",
"=",
"getActionResult",
"(",
"actionResult",
".",
"getActionId",
"(",
")",
")",
";",
"if",
"(",
"existActionResult",
"!=",
"null",
"&&",
"exist... | Adds the action result.
@param actionResult the action result | [
"Adds",
"the",
"action",
"result",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/process/result/ContentResult.java#L95-L105 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/activity/ShellActivity.java | ShellActivity.readParameters | private void readParameters() {
ItemRuleMap parameterItemRuleMap = getRequestRule().getParameterItemRuleMap();
if (parameterItemRuleMap != null && !parameterItemRuleMap.isEmpty()) {
ItemRuleList parameterItemRuleList = new ItemRuleList(parameterItemRuleMap.values());
determineSim... | java | private void readParameters() {
ItemRuleMap parameterItemRuleMap = getRequestRule().getParameterItemRuleMap();
if (parameterItemRuleMap != null && !parameterItemRuleMap.isEmpty()) {
ItemRuleList parameterItemRuleList = new ItemRuleList(parameterItemRuleMap.values());
determineSim... | [
"private",
"void",
"readParameters",
"(",
")",
"{",
"ItemRuleMap",
"parameterItemRuleMap",
"=",
"getRequestRule",
"(",
")",
".",
"getParameterItemRuleMap",
"(",
")",
";",
"if",
"(",
"parameterItemRuleMap",
"!=",
"null",
"&&",
"!",
"parameterItemRuleMap",
".",
"isE... | Read required input parameters. | [
"Read",
"required",
"input",
"parameters",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/activity/ShellActivity.java#L174-L207 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/activity/ShellActivity.java | ShellActivity.readAttributes | private void readAttributes() {
ItemRuleMap attributeItemRuleMap = getRequestRule().getAttributeItemRuleMap();
if (attributeItemRuleMap != null && !attributeItemRuleMap.isEmpty()) {
ItemRuleList attributeItemRuleList = new ItemRuleList(attributeItemRuleMap.values());
determineSim... | java | private void readAttributes() {
ItemRuleMap attributeItemRuleMap = getRequestRule().getAttributeItemRuleMap();
if (attributeItemRuleMap != null && !attributeItemRuleMap.isEmpty()) {
ItemRuleList attributeItemRuleList = new ItemRuleList(attributeItemRuleMap.values());
determineSim... | [
"private",
"void",
"readAttributes",
"(",
")",
"{",
"ItemRuleMap",
"attributeItemRuleMap",
"=",
"getRequestRule",
"(",
")",
".",
"getAttributeItemRuleMap",
"(",
")",
";",
"if",
"(",
"attributeItemRuleMap",
"!=",
"null",
"&&",
"!",
"attributeItemRuleMap",
".",
"isE... | Read required input attributes. | [
"Read",
"required",
"input",
"attributes",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/activity/ShellActivity.java#L248-L281 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/component/bean/AbstractBeanFactory.java | AbstractBeanFactory.destroySingletons | private void destroySingletons() {
if (log.isDebugEnabled()) {
log.debug("Destroying singletons in " + this);
}
int failedDestroyes = 0;
for (BeanRule beanRule : beanRuleRegistry.getIdBasedBeanRules()) {
failedDestroyes += doDestroySingleton(beanRule);
}
... | java | private void destroySingletons() {
if (log.isDebugEnabled()) {
log.debug("Destroying singletons in " + this);
}
int failedDestroyes = 0;
for (BeanRule beanRule : beanRuleRegistry.getIdBasedBeanRules()) {
failedDestroyes += doDestroySingleton(beanRule);
}
... | [
"private",
"void",
"destroySingletons",
"(",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Destroying singletons in \"",
"+",
"this",
")",
";",
"}",
"int",
"failedDestroyes",
"=",
"0",
";",
"for",
"("... | Destroy all cached singletons. | [
"Destroy",
"all",
"cached",
"singletons",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/component/bean/AbstractBeanFactory.java#L445-L467 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/response/transform/TransformResponseFactory.java | TransformResponseFactory.createTransformResponse | public static Response createTransformResponse(TransformRule transformRule) {
TransformType transformType = transformRule.getTransformType();
Response transformResponse;
if (transformType == TransformType.XSL) {
transformResponse = new XslTransformResponse(transformRule);
} e... | java | public static Response createTransformResponse(TransformRule transformRule) {
TransformType transformType = transformRule.getTransformType();
Response transformResponse;
if (transformType == TransformType.XSL) {
transformResponse = new XslTransformResponse(transformRule);
} e... | [
"public",
"static",
"Response",
"createTransformResponse",
"(",
"TransformRule",
"transformRule",
")",
"{",
"TransformType",
"transformType",
"=",
"transformRule",
".",
"getTransformType",
"(",
")",
";",
"Response",
"transformResponse",
";",
"if",
"(",
"transformType",
... | Creates a new Transform object with specified TransformRule.
@param transformRule the transform rule
@return the transform response | [
"Creates",
"a",
"new",
"Transform",
"object",
"with",
"specified",
"TransformRule",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/response/transform/TransformResponseFactory.java#L36-L62 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/builtins/SysInfoCommand.java | SysInfoCommand.mem | private void mem(boolean gc, Console console) {
long total = Runtime.getRuntime().totalMemory();
long before = Runtime.getRuntime().freeMemory();
console.writeLine("%-24s %12s", "Total memory", StringUtils.convertToHumanFriendlyByteSize(total));
console.writeLine("%-24s %12s", "Used mem... | java | private void mem(boolean gc, Console console) {
long total = Runtime.getRuntime().totalMemory();
long before = Runtime.getRuntime().freeMemory();
console.writeLine("%-24s %12s", "Total memory", StringUtils.convertToHumanFriendlyByteSize(total));
console.writeLine("%-24s %12s", "Used mem... | [
"private",
"void",
"mem",
"(",
"boolean",
"gc",
",",
"Console",
"console",
")",
"{",
"long",
"total",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"totalMemory",
"(",
")",
";",
"long",
"before",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
... | Displays memory usage.
@param gc true if performing garbage collection; false otherwise | [
"Displays",
"memory",
"usage",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/builtins/SysInfoCommand.java#L101-L127 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/AspectranActivityContext.java | AspectranActivityContext.initMessageSource | private void initMessageSource() {
if (contextBeanRegistry.containsBean(MESSAGE_SOURCE_BEAN_ID)) {
messageSource = contextBeanRegistry.getBean(MESSAGE_SOURCE_BEAN_ID, MessageSource.class);
if (log.isDebugEnabled()) {
log.debug("Using MessageSource [" + messageSource + "]"... | java | private void initMessageSource() {
if (contextBeanRegistry.containsBean(MESSAGE_SOURCE_BEAN_ID)) {
messageSource = contextBeanRegistry.getBean(MESSAGE_SOURCE_BEAN_ID, MessageSource.class);
if (log.isDebugEnabled()) {
log.debug("Using MessageSource [" + messageSource + "]"... | [
"private",
"void",
"initMessageSource",
"(",
")",
"{",
"if",
"(",
"contextBeanRegistry",
".",
"containsBean",
"(",
"MESSAGE_SOURCE_BEAN_ID",
")",
")",
"{",
"messageSource",
"=",
"contextBeanRegistry",
".",
"getBean",
"(",
"MESSAGE_SOURCE_BEAN_ID",
",",
"MessageSource"... | Initialize the MessageSource.
Use parent's if none defined in this context. | [
"Initialize",
"the",
"MessageSource",
".",
"Use",
"parent",
"s",
"if",
"none",
"defined",
"in",
"this",
"context",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/AspectranActivityContext.java#L197-L211 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/locale/AbstractLocaleResolver.java | AbstractLocaleResolver.resolveDefaultLocale | protected Locale resolveDefaultLocale(Translet translet) {
Locale defaultLocale = getDefaultLocale();
if (defaultLocale != null) {
translet.getRequestAdapter().setLocale(defaultLocale);
return defaultLocale;
} else {
return translet.getRequestAdapter().getLoca... | java | protected Locale resolveDefaultLocale(Translet translet) {
Locale defaultLocale = getDefaultLocale();
if (defaultLocale != null) {
translet.getRequestAdapter().setLocale(defaultLocale);
return defaultLocale;
} else {
return translet.getRequestAdapter().getLoca... | [
"protected",
"Locale",
"resolveDefaultLocale",
"(",
"Translet",
"translet",
")",
"{",
"Locale",
"defaultLocale",
"=",
"getDefaultLocale",
"(",
")",
";",
"if",
"(",
"defaultLocale",
"!=",
"null",
")",
"{",
"translet",
".",
"getRequestAdapter",
"(",
")",
".",
"s... | Resolve the default locale for the given translet,
Called if can not find specified Locale.
@param translet the translet to resolve the locale for
@return the default locale (never {@code null})
@see #setDefaultLocale | [
"Resolve",
"the",
"default",
"locale",
"for",
"the",
"given",
"translet",
"Called",
"if",
"can",
"not",
"find",
"specified",
"Locale",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/locale/AbstractLocaleResolver.java#L98-L106 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/support/i18n/locale/AbstractLocaleResolver.java | AbstractLocaleResolver.resolveDefaultTimeZone | protected TimeZone resolveDefaultTimeZone(Translet translet) {
TimeZone defaultTimeZone = getDefaultTimeZone();
if (defaultTimeZone != null) {
translet.getRequestAdapter().setTimeZone(defaultTimeZone);
return defaultTimeZone;
} else {
return translet.getReques... | java | protected TimeZone resolveDefaultTimeZone(Translet translet) {
TimeZone defaultTimeZone = getDefaultTimeZone();
if (defaultTimeZone != null) {
translet.getRequestAdapter().setTimeZone(defaultTimeZone);
return defaultTimeZone;
} else {
return translet.getReques... | [
"protected",
"TimeZone",
"resolveDefaultTimeZone",
"(",
"Translet",
"translet",
")",
"{",
"TimeZone",
"defaultTimeZone",
"=",
"getDefaultTimeZone",
"(",
")",
";",
"if",
"(",
"defaultTimeZone",
"!=",
"null",
")",
"{",
"translet",
".",
"getRequestAdapter",
"(",
")",... | Resolve the default time zone for the given translet,
Called if can not find specified TimeZone.
@param translet the translet to resolve the time zone for
@return the default time zone (or {@code null} if none defined)
@see #setDefaultTimeZone | [
"Resolve",
"the",
"default",
"time",
"zone",
"for",
"the",
"given",
"translet",
"Called",
"if",
"can",
"not",
"find",
"specified",
"TimeZone",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/support/i18n/locale/AbstractLocaleResolver.java#L116-L124 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/apon/AponReader.java | AponReader.parse | public static Parameters parse(String text) throws AponParseException {
Parameters parameters = new VariableParameters();
return parse(text, parameters);
} | java | public static Parameters parse(String text) throws AponParseException {
Parameters parameters = new VariableParameters();
return parse(text, parameters);
} | [
"public",
"static",
"Parameters",
"parse",
"(",
"String",
"text",
")",
"throws",
"AponParseException",
"{",
"Parameters",
"parameters",
"=",
"new",
"VariableParameters",
"(",
")",
";",
"return",
"parse",
"(",
"text",
",",
"parameters",
")",
";",
"}"
] | Converts an APON formatted string into a Parameters object.
@param text the APON formatted string
@return the Parameters object
@throws AponParseException if reading APON format document fails | [
"Converts",
"an",
"APON",
"formatted",
"string",
"into",
"a",
"Parameters",
"object",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L417-L420 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/apon/AponReader.java | AponReader.parse | public static <T extends Parameters> T parse(String text, T parameters) throws AponParseException {
if (text == null) {
throw new IllegalArgumentException("text must not be null");
}
if (parameters == null) {
throw new IllegalArgumentException("parameters must not be null... | java | public static <T extends Parameters> T parse(String text, T parameters) throws AponParseException {
if (text == null) {
throw new IllegalArgumentException("text must not be null");
}
if (parameters == null) {
throw new IllegalArgumentException("parameters must not be null... | [
"public",
"static",
"<",
"T",
"extends",
"Parameters",
">",
"T",
"parse",
"(",
"String",
"text",
",",
"T",
"parameters",
")",
"throws",
"AponParseException",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Converts an APON formatted string into a given Parameters object.
@param <T> the generic type
@param text the APON formatted string
@param parameters the Parameters object
@return the Parameters object
@throws AponParseException if reading APON format document fails | [
"Converts",
"an",
"APON",
"formatted",
"string",
"into",
"a",
"given",
"Parameters",
"object",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L431-L448 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/apon/AponReader.java | AponReader.parse | public static Parameters parse(File file, String encoding) throws AponParseException {
if (file == null) {
throw new IllegalArgumentException("file must not be null");
}
Parameters parameters = new VariableParameters();
return parse(file, encoding, parameters);
} | java | public static Parameters parse(File file, String encoding) throws AponParseException {
if (file == null) {
throw new IllegalArgumentException("file must not be null");
}
Parameters parameters = new VariableParameters();
return parse(file, encoding, parameters);
} | [
"public",
"static",
"Parameters",
"parse",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"throws",
"AponParseException",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"file must not be null\"",
")",
";"... | Converts to a Parameters object from a file.
@param file the file to parse
@param encoding the character encoding
@return the Parameters object
@throws AponParseException if reading APON format document fails | [
"Converts",
"to",
"a",
"Parameters",
"object",
"from",
"a",
"file",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L469-L475 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/apon/AponReader.java | AponReader.parse | public static Parameters parse(Reader reader) throws AponParseException {
if (reader == null) {
throw new IllegalArgumentException("reader must not be null");
}
AponReader aponReader = new AponReader(reader);
return aponReader.read();
} | java | public static Parameters parse(Reader reader) throws AponParseException {
if (reader == null) {
throw new IllegalArgumentException("reader must not be null");
}
AponReader aponReader = new AponReader(reader);
return aponReader.read();
} | [
"public",
"static",
"Parameters",
"parse",
"(",
"Reader",
"reader",
")",
"throws",
"AponParseException",
"{",
"if",
"(",
"reader",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"reader must not be null\"",
")",
";",
"}",
"AponReader",
... | Converts to a Parameters object from a character-input stream.
@param reader the character-input stream
@return the Parameters object
@throws AponParseException if reading APON format document fails | [
"Converts",
"to",
"a",
"Parameters",
"object",
"from",
"a",
"character",
"-",
"input",
"stream",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L536-L542 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/apon/AponReader.java | AponReader.parse | public static <T extends Parameters> T parse(Reader reader, T parameters) throws AponParseException {
AponReader aponReader = new AponReader(reader);
aponReader.read(parameters);
return parameters;
} | java | public static <T extends Parameters> T parse(Reader reader, T parameters) throws AponParseException {
AponReader aponReader = new AponReader(reader);
aponReader.read(parameters);
return parameters;
} | [
"public",
"static",
"<",
"T",
"extends",
"Parameters",
">",
"T",
"parse",
"(",
"Reader",
"reader",
",",
"T",
"parameters",
")",
"throws",
"AponParseException",
"{",
"AponReader",
"aponReader",
"=",
"new",
"AponReader",
"(",
"reader",
")",
";",
"aponReader",
... | Converts into a given Parameters object from a character-input stream.
@param <T> the generic type
@param reader the character-input stream
@param parameters the Parameters object
@return the Parameters object
@throws AponParseException if reading APON format document fails | [
"Converts",
"into",
"a",
"given",
"Parameters",
"object",
"from",
"a",
"character",
"-",
"input",
"stream",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/apon/AponReader.java#L553-L557 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ExceptionRule.java | ExceptionRule.putExceptionThrownRule | public void putExceptionThrownRule(ExceptionThrownRule exceptionThrownRule) {
exceptionThrownRuleList.add(exceptionThrownRule);
String[] exceptionTypes = exceptionThrownRule.getExceptionTypes();
if (exceptionTypes != null) {
for (String exceptionType : exceptionTypes) {
... | java | public void putExceptionThrownRule(ExceptionThrownRule exceptionThrownRule) {
exceptionThrownRuleList.add(exceptionThrownRule);
String[] exceptionTypes = exceptionThrownRule.getExceptionTypes();
if (exceptionTypes != null) {
for (String exceptionType : exceptionTypes) {
... | [
"public",
"void",
"putExceptionThrownRule",
"(",
"ExceptionThrownRule",
"exceptionThrownRule",
")",
"{",
"exceptionThrownRuleList",
".",
"add",
"(",
"exceptionThrownRule",
")",
";",
"String",
"[",
"]",
"exceptionTypes",
"=",
"exceptionThrownRule",
".",
"getExceptionTypes"... | Puts the exception thrown rule.
@param exceptionThrownRule the exception thrown rule | [
"Puts",
"the",
"exception",
"thrown",
"rule",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ExceptionRule.java#L55-L70 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/ExceptionRule.java | ExceptionRule.getExceptionThrownRule | public ExceptionThrownRule getExceptionThrownRule(Throwable ex) {
ExceptionThrownRule exceptionThrownRule = null;
int deepest = Integer.MAX_VALUE;
for (Map.Entry<String, ExceptionThrownRule> entry : exceptionThrownRuleMap.entrySet()) {
int depth = getMatchedDepth(entry.getKey(), ex);... | java | public ExceptionThrownRule getExceptionThrownRule(Throwable ex) {
ExceptionThrownRule exceptionThrownRule = null;
int deepest = Integer.MAX_VALUE;
for (Map.Entry<String, ExceptionThrownRule> entry : exceptionThrownRuleMap.entrySet()) {
int depth = getMatchedDepth(entry.getKey(), ex);... | [
"public",
"ExceptionThrownRule",
"getExceptionThrownRule",
"(",
"Throwable",
"ex",
")",
"{",
"ExceptionThrownRule",
"exceptionThrownRule",
"=",
"null",
";",
"int",
"deepest",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
... | Gets the exception thrown rule as specified exception.
@param ex the exception
@return the exception thrown rule | [
"Gets",
"the",
"exception",
"thrown",
"rule",
"as",
"specified",
"exception",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/ExceptionRule.java#L78-L89 | train |
aspectran/aspectran | web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java | DefaultServletHttpRequestHandler.lookupDefaultServletName | private void lookupDefaultServletName(ServletContext servletContext) {
if (servletContext.getNamedDispatcher(COMMON_DEFAULT_SERVLET_NAME) != null) {
defaultServletName = COMMON_DEFAULT_SERVLET_NAME;
} else if (servletContext.getNamedDispatcher(RESIN_DEFAULT_SERVLET_NAME) != null) {
... | java | private void lookupDefaultServletName(ServletContext servletContext) {
if (servletContext.getNamedDispatcher(COMMON_DEFAULT_SERVLET_NAME) != null) {
defaultServletName = COMMON_DEFAULT_SERVLET_NAME;
} else if (servletContext.getNamedDispatcher(RESIN_DEFAULT_SERVLET_NAME) != null) {
... | [
"private",
"void",
"lookupDefaultServletName",
"(",
"ServletContext",
"servletContext",
")",
"{",
"if",
"(",
"servletContext",
".",
"getNamedDispatcher",
"(",
"COMMON_DEFAULT_SERVLET_NAME",
")",
"!=",
"null",
")",
"{",
"defaultServletName",
"=",
"COMMON_DEFAULT_SERVLET_NA... | Lookup default servlet name.
@param servletContext the servlet context | [
"Lookup",
"default",
"servlet",
"name",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java#L86-L105 | train |
aspectran/aspectran | web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java | DefaultServletHttpRequestHandler.handle | public boolean handle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (defaultServletName != null) {
RequestDispatcher rd = servletContext.getNamedDispatcher(defaultServletName);
if (rd == null) {
throw new I... | java | public boolean handle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
if (defaultServletName != null) {
RequestDispatcher rd = servletContext.getNamedDispatcher(defaultServletName);
if (rd == null) {
throw new I... | [
"public",
"boolean",
"handle",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"if",
"(",
"defaultServletName",
"!=",
"null",
")",
"{",
"RequestDispatcher",
"rd",
"=",
"servlet... | Process the actual dispatching.
@param request current HTTP servlet request
@param response current HTTP servlet response
@return true, if successful
@throws ServletException the servlet exception
@throws IOException if an input or output error occurs while the servlet is handling the HTTP request | [
"Process",
"the",
"actual",
"dispatching",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/service/DefaultServletHttpRequestHandler.java#L116-L129 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/PBEncryptionUtils.java | PBEncryptionUtils.encrypt | public static String encrypt(String inputString, String encryptionPassword) {
return getEncryptor(encryptionPassword).encrypt(inputString);
} | java | public static String encrypt(String inputString, String encryptionPassword) {
return getEncryptor(encryptionPassword).encrypt(inputString);
} | [
"public",
"static",
"String",
"encrypt",
"(",
"String",
"inputString",
",",
"String",
"encryptionPassword",
")",
"{",
"return",
"getEncryptor",
"(",
"encryptionPassword",
")",
".",
"encrypt",
"(",
"inputString",
")",
";",
"}"
] | Encrypts the inputString using the encryption password.
@param inputString the string to encrypt
@param encryptionPassword the password to be used for encryption
@return the encrypted string | [
"Encrypts",
"the",
"inputString",
"using",
"the",
"encryption",
"password",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/PBEncryptionUtils.java#L74-L76 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/PBEncryptionUtils.java | PBEncryptionUtils.decrypt | public static String decrypt(String inputString, String encryptionPassword) {
checkPassword(encryptionPassword);
return getEncryptor(encryptionPassword).decrypt(inputString);
} | java | public static String decrypt(String inputString, String encryptionPassword) {
checkPassword(encryptionPassword);
return getEncryptor(encryptionPassword).decrypt(inputString);
} | [
"public",
"static",
"String",
"decrypt",
"(",
"String",
"inputString",
",",
"String",
"encryptionPassword",
")",
"{",
"checkPassword",
"(",
"encryptionPassword",
")",
";",
"return",
"getEncryptor",
"(",
"encryptionPassword",
")",
".",
"decrypt",
"(",
"inputString",
... | Decrypts the inputString using the encryption password.
@param inputString the key used to originally encrypt the string
@param encryptionPassword the password to be used for encryption
@return the decrypted version of inputString | [
"Decrypts",
"the",
"inputString",
"using",
"the",
"encryption",
"password",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/PBEncryptionUtils.java#L95-L98 | train |
aspectran/aspectran | web/src/main/java/com/aspectran/web/adapter/HttpSessionAdapter.java | HttpSessionAdapter.newHttpSessionScope | private void newHttpSessionScope() {
SessionScopeAdvisor advisor = SessionScopeAdvisor.create(context);
this.sessionScope = new HttpSessionScope(advisor);
setAttribute(SESSION_SCOPE_ATTRIBUTE_NAME, this.sessionScope);
} | java | private void newHttpSessionScope() {
SessionScopeAdvisor advisor = SessionScopeAdvisor.create(context);
this.sessionScope = new HttpSessionScope(advisor);
setAttribute(SESSION_SCOPE_ATTRIBUTE_NAME, this.sessionScope);
} | [
"private",
"void",
"newHttpSessionScope",
"(",
")",
"{",
"SessionScopeAdvisor",
"advisor",
"=",
"SessionScopeAdvisor",
".",
"create",
"(",
"context",
")",
";",
"this",
".",
"sessionScope",
"=",
"new",
"HttpSessionScope",
"(",
"advisor",
")",
";",
"setAttribute",
... | Creates a new HTTP session scope. | [
"Creates",
"a",
"new",
"HTTP",
"session",
"scope",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/web/src/main/java/com/aspectran/web/adapter/HttpSessionAdapter.java#L156-L160 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java | DefaultOptionParser.handleUnknownToken | private void handleUnknownToken(String token) throws OptionParserException {
if (token.startsWith("-") && token.length() > 1 && !skipParsingAtNonOption) {
throw new UnrecognizedOptionException("Unrecognized option: " + token, token);
}
parsedOptions.addArg(token);
} | java | private void handleUnknownToken(String token) throws OptionParserException {
if (token.startsWith("-") && token.length() > 1 && !skipParsingAtNonOption) {
throw new UnrecognizedOptionException("Unrecognized option: " + token, token);
}
parsedOptions.addArg(token);
} | [
"private",
"void",
"handleUnknownToken",
"(",
"String",
"token",
")",
"throws",
"OptionParserException",
"{",
"if",
"(",
"token",
".",
"startsWith",
"(",
"\"-\"",
")",
"&&",
"token",
".",
"length",
"(",
")",
">",
"1",
"&&",
"!",
"skipParsingAtNonOption",
")"... | Handles an unknown token. If the token starts with a dash an
UnrecognizedOptionException is thrown. Otherwise the token is added
to the arguments of the command line. If the skipParsingAtNonOption flag
is set, this stops the parsing and the remaining tokens are added
as-is in the arguments of the command line.
@param ... | [
"Handles",
"an",
"unknown",
"token",
".",
"If",
"the",
"token",
"starts",
"with",
"a",
"dash",
"an",
"UnrecognizedOptionException",
"is",
"thrown",
".",
"Otherwise",
"the",
"token",
"is",
"added",
"to",
"the",
"arguments",
"of",
"the",
"command",
"line",
"."... | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java#L392-L397 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java | DefaultOptionParser.getMatchingLongOptions | private List<String> getMatchingLongOptions(String token) {
if (allowPartialMatching) {
return options.getMatchingOptions(token);
} else {
List<String> matches = new ArrayList<>(1);
if (options.hasLongOption(token)) {
Option option = options.getOption(... | java | private List<String> getMatchingLongOptions(String token) {
if (allowPartialMatching) {
return options.getMatchingOptions(token);
} else {
List<String> matches = new ArrayList<>(1);
if (options.hasLongOption(token)) {
Option option = options.getOption(... | [
"private",
"List",
"<",
"String",
">",
"getMatchingLongOptions",
"(",
"String",
"token",
")",
"{",
"if",
"(",
"allowPartialMatching",
")",
"{",
"return",
"options",
".",
"getMatchingOptions",
"(",
"token",
")",
";",
"}",
"else",
"{",
"List",
"<",
"String",
... | Returns a list of matching option strings for the given token, depending
on the selected partial matching policy.
@param token the token (may contain leading dashes)
@return the list of matching option strings or an empty list if no
matching option could be found | [
"Returns",
"a",
"list",
"of",
"matching",
"option",
"strings",
"for",
"the",
"given",
"token",
"depending",
"on",
"the",
"selected",
"partial",
"matching",
"policy",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/DefaultOptionParser.java#L538-L549 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getAllMethods | private Method[] getAllMethods(Class<?> beanClass) {
Map<String, Method> uniqueMethods = new HashMap<>();
Class<?> currentClass = beanClass;
while (currentClass != null && currentClass != Object.class) {
addUniqueMethods(uniqueMethods, currentClass.getDeclaredMethods());
... | java | private Method[] getAllMethods(Class<?> beanClass) {
Map<String, Method> uniqueMethods = new HashMap<>();
Class<?> currentClass = beanClass;
while (currentClass != null && currentClass != Object.class) {
addUniqueMethods(uniqueMethods, currentClass.getDeclaredMethods());
... | [
"private",
"Method",
"[",
"]",
"getAllMethods",
"(",
"Class",
"<",
"?",
">",
"beanClass",
")",
"{",
"Map",
"<",
"String",
",",
"Method",
">",
"uniqueMethods",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Class",
"<",
"?",
">",
"currentClass",
"=",
"b... | This method returns an array containing all methods exposed in this
class and any superclass. In the future, Java is not pleased to have
access to private or protected methods.
@param beanClass the class
@return an array containing all the public methods in this class | [
"This",
"method",
"returns",
"an",
"array",
"containing",
"all",
"methods",
"exposed",
"in",
"this",
"class",
"and",
"any",
"superclass",
".",
"In",
"the",
"future",
"Java",
"is",
"not",
"pleased",
"to",
"have",
"access",
"to",
"private",
"or",
"protected",
... | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L177-L193 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getGetter | public Method getGetter(String name) throws NoSuchMethodException {
Method method = getterMethods.get(name);
if (method == null) {
throw new NoSuchMethodException("There is no READABLE property named '" + name +
"' in class '" + className + "'");
}
return ... | java | public Method getGetter(String name) throws NoSuchMethodException {
Method method = getterMethods.get(name);
if (method == null) {
throw new NoSuchMethodException("There is no READABLE property named '" + name +
"' in class '" + className + "'");
}
return ... | [
"public",
"Method",
"getGetter",
"(",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
"{",
"Method",
"method",
"=",
"getterMethods",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"NoSuchMethodExcept... | Gets the getter for a property as a Method object.
@param name the name of the property
@return the getter Method
@throws NoSuchMethodException when a getter method cannot be found | [
"Gets",
"the",
"getter",
"for",
"a",
"property",
"as",
"a",
"Method",
"object",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L245-L252 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getSetter | public Method getSetter(String name) throws NoSuchMethodException {
Method method = setterMethods.get(name);
if (method == null) {
throw new NoSuchMethodException("There is no WRITABLE property named '" + name +
"' in class '" + className + "'");
}
return ... | java | public Method getSetter(String name) throws NoSuchMethodException {
Method method = setterMethods.get(name);
if (method == null) {
throw new NoSuchMethodException("There is no WRITABLE property named '" + name +
"' in class '" + className + "'");
}
return ... | [
"public",
"Method",
"getSetter",
"(",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
"{",
"Method",
"method",
"=",
"setterMethods",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"throw",
"new",
"NoSuchMethodExcept... | Gets the setter for a property as a Method object.
@param name the name of the property
@return the setter method
@throws NoSuchMethodException when a setter method cannot be found | [
"Gets",
"the",
"setter",
"for",
"a",
"property",
"as",
"a",
"Method",
"object",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L261-L268 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getGetterType | public Class<?> getGetterType(String name) throws NoSuchMethodException {
Class<?> type = getterTypes.get(name);
if (type == null) {
throw new NoSuchMethodException("There is no READABLE property named '" + name +
"' in class '" + className + "'");
}
retur... | java | public Class<?> getGetterType(String name) throws NoSuchMethodException {
Class<?> type = getterTypes.get(name);
if (type == null) {
throw new NoSuchMethodException("There is no READABLE property named '" + name +
"' in class '" + className + "'");
}
retur... | [
"public",
"Class",
"<",
"?",
">",
"getGetterType",
"(",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"getterTypes",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"... | Gets the type for a property getter.
@param name the name of the property
@return the Class of the property getter
@throws NoSuchMethodException when a getter method cannot be found | [
"Gets",
"the",
"type",
"for",
"a",
"property",
"getter",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L277-L284 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getSetterType | public Class<?> getSetterType(String name) throws NoSuchMethodException {
Class<?> type = setterTypes.get(name);
if (type == null) {
throw new NoSuchMethodException("There is no WRITABLE property named '" + name +
"' in class '" + className + "'");
}
retur... | java | public Class<?> getSetterType(String name) throws NoSuchMethodException {
Class<?> type = setterTypes.get(name);
if (type == null) {
throw new NoSuchMethodException("There is no WRITABLE property named '" + name +
"' in class '" + className + "'");
}
retur... | [
"public",
"Class",
"<",
"?",
">",
"getSetterType",
"(",
"String",
"name",
")",
"throws",
"NoSuchMethodException",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"setterTypes",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"... | Gets the type for a property setter.
@param name the name of the property
@return the Class of the property setter
@throws NoSuchMethodException when a setter method cannot be found | [
"Gets",
"the",
"type",
"for",
"a",
"property",
"setter",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L293-L300 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/BeanDescriptor.java | BeanDescriptor.getInstance | public static BeanDescriptor getInstance(Class<?> type) {
BeanDescriptor bd = cache.get(type);
if (bd == null) {
bd = new BeanDescriptor(type);
BeanDescriptor existing = cache.putIfAbsent(type, bd);
if (existing != null) {
bd = existing;
}
... | java | public static BeanDescriptor getInstance(Class<?> type) {
BeanDescriptor bd = cache.get(type);
if (bd == null) {
bd = new BeanDescriptor(type);
BeanDescriptor existing = cache.putIfAbsent(type, bd);
if (existing != null) {
bd = existing;
}
... | [
"public",
"static",
"BeanDescriptor",
"getInstance",
"(",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"BeanDescriptor",
"bd",
"=",
"cache",
".",
"get",
"(",
"type",
")",
";",
"if",
"(",
"bd",
"==",
"null",
")",
"{",
"bd",
"=",
"new",
"BeanDescriptor",
... | Gets an instance of ClassDescriptor for the specified class.
@param type the class for which to lookup the method cache
@return the method cache for the class | [
"Gets",
"an",
"instance",
"of",
"ClassDescriptor",
"for",
"the",
"specified",
"class",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/BeanDescriptor.java#L399-L409 | train |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java | ParsedOptions.resolveOption | private Option resolveOption(String name) {
name = OptionUtils.stripLeadingHyphens(name);
for (Option option : options) {
if (name.equals(option.getName())) {
return option;
}
if (name.equals(option.getLongName())) {
return option;
... | java | private Option resolveOption(String name) {
name = OptionUtils.stripLeadingHyphens(name);
for (Option option : options) {
if (name.equals(option.getName())) {
return option;
}
if (name.equals(option.getLongName())) {
return option;
... | [
"private",
"Option",
"resolveOption",
"(",
"String",
"name",
")",
"{",
"name",
"=",
"OptionUtils",
".",
"stripLeadingHyphens",
"(",
"name",
")",
";",
"for",
"(",
"Option",
"option",
":",
"options",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"option... | Retrieves the option object given the long or short option as a String.
@param name the short or long name of the option
@return the canonicalized option | [
"Retrieves",
"the",
"option",
"object",
"given",
"the",
"long",
"or",
"short",
"option",
"as",
"a",
"String",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java#L295-L306 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/context/rule/IncludeActionRule.java | IncludeActionRule.newInstance | public static IncludeActionRule newInstance(String id, String transletName, String method, Boolean hidden)
throws IllegalRuleException {
if (transletName == null) {
throw new IllegalRuleException("The 'include' element requires a 'translet' attribute");
}
MethodType meth... | java | public static IncludeActionRule newInstance(String id, String transletName, String method, Boolean hidden)
throws IllegalRuleException {
if (transletName == null) {
throw new IllegalRuleException("The 'include' element requires a 'translet' attribute");
}
MethodType meth... | [
"public",
"static",
"IncludeActionRule",
"newInstance",
"(",
"String",
"id",
",",
"String",
"transletName",
",",
"String",
"method",
",",
"Boolean",
"hidden",
")",
"throws",
"IllegalRuleException",
"{",
"if",
"(",
"transletName",
"==",
"null",
")",
"{",
"throw",... | Returns a new instance of IncludeActionRule.
@param id the action id
@param transletName the translet name
@param method the request method type
@param hidden whether to hide result of the action
@return the include action rule
@throws IllegalRuleException if an illegal rule is found | [
"Returns",
"a",
"new",
"instance",
"of",
"IncludeActionRule",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/context/rule/IncludeActionRule.java#L223-L240 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/FileLocker.java | FileLocker.lock | public boolean lock() throws Exception {
synchronized (this) {
if (fileLock != null) {
throw new Exception("The lock is already held");
}
if (log.isDebugEnabled()) {
log.debug("Acquiring lock on " + lockFile.getAbsolutePath());
}
... | java | public boolean lock() throws Exception {
synchronized (this) {
if (fileLock != null) {
throw new Exception("The lock is already held");
}
if (log.isDebugEnabled()) {
log.debug("Acquiring lock on " + lockFile.getAbsolutePath());
}
... | [
"public",
"boolean",
"lock",
"(",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"fileLock",
"!=",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"The lock is already held\"",
")",
";",
"}",
"if",
"(",
"log",
".... | Try to lock the file and return true if the locking succeeds.
@return true if the locking succeeds; false if the lock is already held
@throws Exception if the lock could not be obtained for any reason | [
"Try",
"to",
"lock",
"the",
"file",
"and",
"return",
"true",
"if",
"the",
"locking",
"succeeds",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/FileLocker.java#L62-L91 | train |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/FileLocker.java | FileLocker.release | public void release() throws Exception {
synchronized (this) {
if (log.isDebugEnabled()) {
log.debug("Releasing lock on " + lockFile.getAbsolutePath());
}
if (fileLock != null) {
try {
fileLock.release();
... | java | public void release() throws Exception {
synchronized (this) {
if (log.isDebugEnabled()) {
log.debug("Releasing lock on " + lockFile.getAbsolutePath());
}
if (fileLock != null) {
try {
fileLock.release();
... | [
"public",
"void",
"release",
"(",
")",
"throws",
"Exception",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"log",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"log",
".",
"debug",
"(",
"\"Releasing lock on \"",
"+",
"lockFile",
".",
"getAbsolutePat... | Releases the lock.
@throws Exception if the lock could not be released for any reason | [
"Releases",
"the",
"lock",
"."
] | 2d758a2a28b71ee85b42823c12dc44674d7f2c70 | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/FileLocker.java#L98-L126 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/ApiEndpointControllerService.java | ApiEndpointControllerService.get | @GET
@Produces(MediaType.APPLICATION_JSON)
public String[] get(@HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
return controller.getDisabled();
} | java | @GET
@Produces(MediaType.APPLICATION_JSON)
public String[] get(@HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
return controller.getDisabled();
} | [
"@",
"GET",
"@",
"Produces",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"String",
"[",
"]",
"get",
"(",
"@",
"HeaderParam",
"(",
"\"Authorization\"",
")",
"@",
"DefaultValue",
"(",
"\"no token\"",
")",
"String",
"auth",
")",
"throws",
"Excepti... | Retrieves a list of already disabled endpoints.
@param auth
@return
@throws Exception | [
"Retrieves",
"a",
"list",
"of",
"already",
"disabled",
"endpoints",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/ApiEndpointControllerService.java#L64-L71 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/ApiEndpointControllerService.java | ApiEndpointControllerService.sendJGroupsMessage | private void sendJGroupsMessage(UpdateOpteration operation, String path,
String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
log.trace("Sending jGroups message with operation {} and path {}", operation, path);
ApiEndpointAccessRequest messageBody ... | java | private void sendJGroupsMessage(UpdateOpteration operation, String path,
String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
log.trace("Sending jGroups message with operation {} and path {}", operation, path);
ApiEndpointAccessRequest messageBody ... | [
"private",
"void",
"sendJGroupsMessage",
"(",
"UpdateOpteration",
"operation",
",",
"String",
"path",
",",
"String",
"auth",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"this",
".",
"isAuth",
"(",
"auth",
")",
")",
"{",
"throw",
"new",
"Exception",
"(... | Sends jgroups message to make sure that this operation is executed on all nodes in the cluster.
@param operation
@param paths
@param auth
@throws Exception | [
"Sends",
"jgroups",
"message",
"to",
"make",
"sure",
"that",
"this",
"operation",
"is",
"executed",
"on",
"all",
"nodes",
"in",
"the",
"cluster",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/ApiEndpointControllerService.java#L106-L118 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java | TupleMRConfig.getIntermediateSchema | public Schema getIntermediateSchema(String schemaName) {
Integer id = getSchemaIdByName(schemaName);
return (id == null) ? null : schemas.get(id);
} | java | public Schema getIntermediateSchema(String schemaName) {
Integer id = getSchemaIdByName(schemaName);
return (id == null) ? null : schemas.get(id);
} | [
"public",
"Schema",
"getIntermediateSchema",
"(",
"String",
"schemaName",
")",
"{",
"Integer",
"id",
"=",
"getSchemaIdByName",
"(",
"schemaName",
")",
";",
"return",
"(",
"id",
"==",
"null",
")",
"?",
"null",
":",
"schemas",
".",
"get",
"(",
"id",
")",
"... | Returns a defined intermediate schema with the specified name | [
"Returns",
"a",
"defined",
"intermediate",
"schema",
"with",
"the",
"specified",
"name"
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java#L114-L117 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java | TupleMRConfig.calculateRollupBaseFields | public List<String> calculateRollupBaseFields() {
if(rollupFrom == null) {
return getGroupByFields();
}
List<String> result = new ArrayList<String>();
for(SortElement element : commonCriteria.getElements()) {
result.add(element.getName());
if(element.getName().equals(rollupFrom)) {
break;
}
}... | java | public List<String> calculateRollupBaseFields() {
if(rollupFrom == null) {
return getGroupByFields();
}
List<String> result = new ArrayList<String>();
for(SortElement element : commonCriteria.getElements()) {
result.add(element.getName());
if(element.getName().equals(rollupFrom)) {
break;
}
}... | [
"public",
"List",
"<",
"String",
">",
"calculateRollupBaseFields",
"(",
")",
"{",
"if",
"(",
"rollupFrom",
"==",
"null",
")",
"{",
"return",
"getGroupByFields",
"(",
")",
";",
"}",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"Stri... | Returns the fields that are a subset from the groupBy fields and will be
used when rollup is needed.
@see RollupReducer | [
"Returns",
"the",
"fields",
"that",
"are",
"a",
"subset",
"from",
"the",
"groupBy",
"fields",
"and",
"will",
"be",
"used",
"when",
"rollup",
"is",
"needed",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java#L239-L252 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java | TupleMRConfig.set | public static Set<String> set(TupleMRConfig mrConfig, Configuration conf)
throws TupleMRException {
conf.set(CONF_PANGOOL_CONF, mrConfig.toString());
return serializeComparators(mrConfig, conf);
} | java | public static Set<String> set(TupleMRConfig mrConfig, Configuration conf)
throws TupleMRException {
conf.set(CONF_PANGOOL_CONF, mrConfig.toString());
return serializeComparators(mrConfig, conf);
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"set",
"(",
"TupleMRConfig",
"mrConfig",
",",
"Configuration",
"conf",
")",
"throws",
"TupleMRException",
"{",
"conf",
".",
"set",
"(",
"CONF_PANGOOL_CONF",
",",
"mrConfig",
".",
"toString",
"(",
")",
")",
";",
... | Returns the instance files generated. | [
"Returns",
"the",
"instance",
"files",
"generated",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java#L335-L339 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java | TupleMRConfig.serializeComparators | static Set<String> serializeComparators(Criteria criteria, Configuration conf,
List<String> comparatorRefs, List<String> comparatorInstanceFiles, String prefix)
throws TupleMRException {
Set<String> instanceFiles = new HashSet<String>();
if(criteria == null) {
return instanceFiles;
}
for(SortE... | java | static Set<String> serializeComparators(Criteria criteria, Configuration conf,
List<String> comparatorRefs, List<String> comparatorInstanceFiles, String prefix)
throws TupleMRException {
Set<String> instanceFiles = new HashSet<String>();
if(criteria == null) {
return instanceFiles;
}
for(SortE... | [
"static",
"Set",
"<",
"String",
">",
"serializeComparators",
"(",
"Criteria",
"criteria",
",",
"Configuration",
"conf",
",",
"List",
"<",
"String",
">",
"comparatorRefs",
",",
"List",
"<",
"String",
">",
"comparatorInstanceFiles",
",",
"String",
"prefix",
")",
... | Returns the instance files created | [
"Returns",
"the",
"instance",
"files",
"created"
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java#L390-L427 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java | TupleMRConfig.parse | public static TupleMRConfig parse(String s) throws IOException {
return parse(FACTORY.createJsonParser(new StringReader(s)));
} | java | public static TupleMRConfig parse(String s) throws IOException {
return parse(FACTORY.createJsonParser(new StringReader(s)));
} | [
"public",
"static",
"TupleMRConfig",
"parse",
"(",
"String",
"s",
")",
"throws",
"IOException",
"{",
"return",
"parse",
"(",
"FACTORY",
".",
"createJsonParser",
"(",
"new",
"StringReader",
"(",
"s",
")",
")",
")",
";",
"}"
] | Parse a schema from the provided string. If named, the schema is added to
the names known to this parser. | [
"Parse",
"a",
"schema",
"from",
"the",
"provided",
"string",
".",
"If",
"named",
"the",
"schema",
"is",
"added",
"to",
"the",
"names",
"known",
"to",
"this",
"parser",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/TupleMRConfig.java#L607-L609 | train |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/FidelityOptions.java | FidelityOptions.setFidelity | public void setFidelity(String key, boolean decision)
throws UnsupportedOption {
if (key.equals(FEATURE_STRICT)) {
if (decision) {
// no other features allowed
// (LEXICAL_VALUE is an exception)
boolean prevContainedLexVal = options
.contains(FEATURE_LEXICAL_VALUE);
options.clear();
i... | java | public void setFidelity(String key, boolean decision)
throws UnsupportedOption {
if (key.equals(FEATURE_STRICT)) {
if (decision) {
// no other features allowed
// (LEXICAL_VALUE is an exception)
boolean prevContainedLexVal = options
.contains(FEATURE_LEXICAL_VALUE);
options.clear();
i... | [
"public",
"void",
"setFidelity",
"(",
"String",
"key",
",",
"boolean",
"decision",
")",
"throws",
"UnsupportedOption",
"{",
"if",
"(",
"key",
".",
"equals",
"(",
"FEATURE_STRICT",
")",
")",
"{",
"if",
"(",
"decision",
")",
"{",
"// no other features allowed",
... | Enables or disables the specified fidelity feature.
@param key
referring to a specific feature
@param decision
enabling or disabling feature
@throws UnsupportedOption
if option is not supported | [
"Enables",
"or",
"disables",
"the",
"specified",
"fidelity",
"feature",
"."
] | b6026c5fd39e9cc3d7874caa20f084e264e0ddc7 | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/FidelityOptions.java#L153-L242 | train |
datasalt/pangool | core/src/main/java/org/apache/avro/mapreduce/lib/output/AvroOutputFormat.java | AvroOutputFormat.setDeflateLevel | public static void setDeflateLevel(Job job, int level) {
FileOutputFormat.setCompressOutput(job, true);
job.getConfiguration().setInt(DEFLATE_LEVEL_KEY, level);
} | java | public static void setDeflateLevel(Job job, int level) {
FileOutputFormat.setCompressOutput(job, true);
job.getConfiguration().setInt(DEFLATE_LEVEL_KEY, level);
} | [
"public",
"static",
"void",
"setDeflateLevel",
"(",
"Job",
"job",
",",
"int",
"level",
")",
"{",
"FileOutputFormat",
".",
"setCompressOutput",
"(",
"job",
",",
"true",
")",
";",
"job",
".",
"getConfiguration",
"(",
")",
".",
"setInt",
"(",
"DEFLATE_LEVEL_KEY... | Enable output compression using the deflate codec and specify its level. | [
"Enable",
"output",
"compression",
"using",
"the",
"deflate",
"codec",
"and",
"specify",
"its",
"level",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/org/apache/avro/mapreduce/lib/output/AvroOutputFormat.java#L66-L69 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/LogMetadata.java | LogMetadata.of | public static LogMetadata of(String key, Object value) {
Map<String, Object> map = new HashMap<>();
map.put(key, value);
return new LogMetadata(map);
} | java | public static LogMetadata of(String key, Object value) {
Map<String, Object> map = new HashMap<>();
map.put(key, value);
return new LogMetadata(map);
} | [
"public",
"static",
"LogMetadata",
"of",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"map",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"... | Create a new metadata marker with a single key-value pair.
@param key the key to add
@param value the value to add for that key | [
"Create",
"a",
"new",
"metadata",
"marker",
"with",
"a",
"single",
"key",
"-",
"value",
"pair",
"."
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/LogMetadata.java#L46-L50 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/LogMetadata.java | LogMetadata.logOtl | public static <T extends OtlType> LogMetadata logOtl(T otl) {
return new LogMetadata(Collections.emptyMap()).andInline(otl);
} | java | public static <T extends OtlType> LogMetadata logOtl(T otl) {
return new LogMetadata(Collections.emptyMap()).andInline(otl);
} | [
"public",
"static",
"<",
"T",
"extends",
"OtlType",
">",
"LogMetadata",
"logOtl",
"(",
"T",
"otl",
")",
"{",
"return",
"new",
"LogMetadata",
"(",
"Collections",
".",
"emptyMap",
"(",
")",
")",
".",
"andInline",
"(",
"otl",
")",
";",
"}"
] | Add an OTL object to the log message
@param otl the OTL item to log
@return the metadata marker | [
"Add",
"an",
"OTL",
"object",
"to",
"the",
"log",
"message"
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/LogMetadata.java#L57-L59 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/LogMetadata.java | LogMetadata.and | public LogMetadata and(String key, Object value) {
metadata.put(key, value);
return this;
} | java | public LogMetadata and(String key, Object value) {
metadata.put(key, value);
return this;
} | [
"public",
"LogMetadata",
"and",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"metadata",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Extend a metadata marker with another key-value pair.
@param key the key to add
@param value the value for the key | [
"Extend",
"a",
"metadata",
"marker",
"with",
"another",
"key",
"-",
"value",
"pair",
"."
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/LogMetadata.java#L66-L69 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java | AbstractAuthorizedOnly.compilePattern | private static Pattern compilePattern( String regex, Logger logger ) {
try {
return Pattern.compile(regex);
}
catch( PatternSyntaxException pse ) {
logger.error("Could not compile regex "+regex, pse);
}
return null;
} | java | private static Pattern compilePattern( String regex, Logger logger ) {
try {
return Pattern.compile(regex);
}
catch( PatternSyntaxException pse ) {
logger.error("Could not compile regex "+regex, pse);
}
return null;
} | [
"private",
"static",
"Pattern",
"compilePattern",
"(",
"String",
"regex",
",",
"Logger",
"logger",
")",
"{",
"try",
"{",
"return",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"}",
"catch",
"(",
"PatternSyntaxException",
"pse",
")",
"{",
"logger",
".... | Compiles the given regex. Returns null if the pattern could not be compiled and logs an error message to the
specified logger.
@param regex the regular expression to compile.
@param logger the logger to notify of errors.
@return The compiled regular expression, or null if it could not be compiled. | [
"Compiles",
"the",
"given",
"regex",
".",
"Returns",
"null",
"if",
"the",
"pattern",
"could",
"not",
"be",
"compiled",
"and",
"logs",
"an",
"error",
"message",
"to",
"the",
"specified",
"logger",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java#L55-L63 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java | AbstractAuthorizedOnly.getSecureBaseUrl | protected String getSecureBaseUrl(String siteUrl) {
if(!siteUrl.startsWith("http://") && !siteUrl.startsWith("https://")) {
siteUrl = "http://" + siteUrl;
}
Matcher urlMatcher = URL_PATTERN.matcher(siteUrl);
if(urlMatcher.matches()) {
logger.debug("Url matches [{}]", siteUrl);
boolean ... | java | protected String getSecureBaseUrl(String siteUrl) {
if(!siteUrl.startsWith("http://") && !siteUrl.startsWith("https://")) {
siteUrl = "http://" + siteUrl;
}
Matcher urlMatcher = URL_PATTERN.matcher(siteUrl);
if(urlMatcher.matches()) {
logger.debug("Url matches [{}]", siteUrl);
boolean ... | [
"protected",
"String",
"getSecureBaseUrl",
"(",
"String",
"siteUrl",
")",
"{",
"if",
"(",
"!",
"siteUrl",
".",
"startsWith",
"(",
"\"http://\"",
")",
"&&",
"!",
"siteUrl",
".",
"startsWith",
"(",
"\"https://\"",
")",
")",
"{",
"siteUrl",
"=",
"\"http://\"",
... | Converts the passed in siteUrl to be https if not already or not local.
@param siteUrl The url of a cadmium site.
@return The passed in siteUrl or the same url but converted to https. | [
"Converts",
"the",
"passed",
"in",
"siteUrl",
"to",
"be",
"https",
"if",
"not",
"already",
"or",
"not",
"local",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java#L110-L131 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java | AbstractAuthorizedOnly.httpClient | protected static HttpClient httpClient() throws Exception {
return HttpClients.custom()
.setHostnameVerifier(new AllowAllHostnameVerifier())
.setSslcontext(SSLContexts.custom()
.loadTrustMaterial(null, new TrustStrategy() {
@Override
public boolean isTrusted(X... | java | protected static HttpClient httpClient() throws Exception {
return HttpClients.custom()
.setHostnameVerifier(new AllowAllHostnameVerifier())
.setSslcontext(SSLContexts.custom()
.loadTrustMaterial(null, new TrustStrategy() {
@Override
public boolean isTrusted(X... | [
"protected",
"static",
"HttpClient",
"httpClient",
"(",
")",
"throws",
"Exception",
"{",
"return",
"HttpClients",
".",
"custom",
"(",
")",
".",
"setHostnameVerifier",
"(",
"new",
"AllowAllHostnameVerifier",
"(",
")",
")",
".",
"setSslcontext",
"(",
"SSLContexts",
... | Sets the Commons HttpComponents to accept all SSL Certificates.
@throws Exception
@return An instance of HttpClient that will accept all. | [
"Sets",
"the",
"Commons",
"HttpComponents",
"to",
"accept",
"all",
"SSL",
"Certificates",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/AbstractAuthorizedOnly.java#L149-L161 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/ValidateCommand.java | ValidateCommand.addCurrentDirFiles | private void addCurrentDirFiles(List<File> theFiles, List<File> theDirs, File currentDir) {
File dirs[] = currentDir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory() && !file.getName().startsWith(".") && !file.getName().equals("META-INF");
... | java | private void addCurrentDirFiles(List<File> theFiles, List<File> theDirs, File currentDir) {
File dirs[] = currentDir.listFiles(new FileFilter() {
@Override
public boolean accept(File file) {
return file.isDirectory() && !file.getName().startsWith(".") && !file.getName().equals("META-INF");
... | [
"private",
"void",
"addCurrentDirFiles",
"(",
"List",
"<",
"File",
">",
"theFiles",
",",
"List",
"<",
"File",
">",
"theDirs",
",",
"File",
"currentDir",
")",
"{",
"File",
"dirs",
"[",
"]",
"=",
"currentDir",
".",
"listFiles",
"(",
"new",
"FileFilter",
"(... | Adds all html files to the list passed in.
@param theFiles The list to populate with the current directory's html files.
@param theDirs The list to populate with the current directory's child directories.
@param currentDir The current directory. | [
"Adds",
"all",
"html",
"files",
"to",
"the",
"list",
"passed",
"in",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/ValidateCommand.java#L116-L141 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/tuplemr/MapOnlyJobBuilder.java | MapOnlyJobBuilder.setDefaultNamedOutput | public void setDefaultNamedOutput(OutputFormat outputFormat, Class keyClass, Class valueClass) throws TupleMRException {
setDefaultNamedOutput(outputFormat, keyClass, valueClass, null);
} | java | public void setDefaultNamedOutput(OutputFormat outputFormat, Class keyClass, Class valueClass) throws TupleMRException {
setDefaultNamedOutput(outputFormat, keyClass, valueClass, null);
} | [
"public",
"void",
"setDefaultNamedOutput",
"(",
"OutputFormat",
"outputFormat",
",",
"Class",
"keyClass",
",",
"Class",
"valueClass",
")",
"throws",
"TupleMRException",
"{",
"setDefaultNamedOutput",
"(",
"outputFormat",
",",
"keyClass",
",",
"valueClass",
",",
"null",... | Sets the default named output specs. By using this method one can use an arbitrary number of named outputs
without pre-defining them beforehand. | [
"Sets",
"the",
"default",
"named",
"output",
"specs",
".",
"By",
"using",
"this",
"method",
"one",
"can",
"use",
"an",
"arbitrary",
"number",
"of",
"named",
"outputs",
"without",
"pre",
"-",
"defining",
"them",
"beforehand",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/tuplemr/MapOnlyJobBuilder.java#L103-L105 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java | PersistablePropertiesRealm.getProperties | public Properties getProperties() {
Properties props = new Properties();
for(String name : this.users.keySet()) {
SimpleAccount acct = this.users.get(name);
props.setProperty(USERNAME_PREFIX + name, acct.getCredentials().toString());
}
return props;
} | java | public Properties getProperties() {
Properties props = new Properties();
for(String name : this.users.keySet()) {
SimpleAccount acct = this.users.get(name);
props.setProperty(USERNAME_PREFIX + name, acct.getCredentials().toString());
}
return props;
} | [
"public",
"Properties",
"getProperties",
"(",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"String",
"name",
":",
"this",
".",
"users",
".",
"keySet",
"(",
")",
")",
"{",
"SimpleAccount",
"acct",
"=",
"this",
".... | Dump properties file backed with this Realms Users and roles.
@return | [
"Dump",
"properties",
"file",
"backed",
"with",
"this",
"Realms",
"Users",
"and",
"roles",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java#L56-L63 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java | PersistablePropertiesRealm.listUsers | public List<String> listUsers() {
List<String> users = new ArrayList<String>(this.users.keySet());
Collections.sort(users);
return users;
} | java | public List<String> listUsers() {
List<String> users = new ArrayList<String>(this.users.keySet());
Collections.sort(users);
return users;
} | [
"public",
"List",
"<",
"String",
">",
"listUsers",
"(",
")",
"{",
"List",
"<",
"String",
">",
"users",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"this",
".",
"users",
".",
"keySet",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"user... | Lists all existing user accounts.
@return | [
"Lists",
"all",
"existing",
"user",
"accounts",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/shiro/PersistablePropertiesRealm.java#L79-L83 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/CaptureAppender.java | CaptureAppender.capture | public static List<ILoggingEvent> capture(Logger logger) {
CaptureAppender capture = new CaptureAppender();
((ch.qos.logback.classic.Logger) logger).addAppender(capture);
capture.start();
return capture.captured;
} | java | public static List<ILoggingEvent> capture(Logger logger) {
CaptureAppender capture = new CaptureAppender();
((ch.qos.logback.classic.Logger) logger).addAppender(capture);
capture.start();
return capture.captured;
} | [
"public",
"static",
"List",
"<",
"ILoggingEvent",
">",
"capture",
"(",
"Logger",
"logger",
")",
"{",
"CaptureAppender",
"capture",
"=",
"new",
"CaptureAppender",
"(",
")",
";",
"(",
"(",
"ch",
".",
"qos",
".",
"logback",
".",
"classic",
".",
"Logger",
")... | Capture a Logger.
@param logger the Logger to capture
@return an updating list of logged events | [
"Capture",
"a",
"Logger",
"."
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/CaptureAppender.java#L69-L74 | train |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/InternetAddressSet.java | InternetAddressSet.add | public boolean add( Object o )
{
boolean result = false;
if( o == null ) {
throw new IllegalArgumentException("Address sets do not support null.");
}
else if( o instanceof String ) {
result = super.add(convertAddress((String)o));
}
else if( o instanceof InternetAddress ) {
re... | java | public boolean add( Object o )
{
boolean result = false;
if( o == null ) {
throw new IllegalArgumentException("Address sets do not support null.");
}
else if( o instanceof String ) {
result = super.add(convertAddress((String)o));
}
else if( o instanceof InternetAddress ) {
re... | [
"public",
"boolean",
"add",
"(",
"Object",
"o",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Address sets do not support null.\"",
")",
";",
"}",
"else",
"if",
... | Adds a specified address to this set. If o is an instance of String, then a new InternetAddress is created and that
object is added to the set. If o is an instance of InternetAddress, then it is added to the set. All other values of
o, including null, throw an IllegalArgumentException. | [
"Adds",
"a",
"specified",
"address",
"to",
"this",
"set",
".",
"If",
"o",
"is",
"an",
"instance",
"of",
"String",
"then",
"a",
"new",
"InternetAddress",
"is",
"created",
"and",
"that",
"object",
"is",
"added",
"to",
"the",
"set",
".",
"If",
"o",
"is",
... | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/InternetAddressSet.java#L51-L67 | train |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/serialization/ProtoStuffSerialization.java | ProtoStuffSerialization.enableProtoStuffSerialization | public static void enableProtoStuffSerialization(Configuration conf) {
String ser = conf.get("io.serializations").trim();
if(ser.length() != 0) {
ser += ",";
}
// Adding the ProtoStuff serialization
ser += ProtoStuffSerialization.class.getName();
conf.set("io.serializations", ser);
} | java | public static void enableProtoStuffSerialization(Configuration conf) {
String ser = conf.get("io.serializations").trim();
if(ser.length() != 0) {
ser += ",";
}
// Adding the ProtoStuff serialization
ser += ProtoStuffSerialization.class.getName();
conf.set("io.serializations", ser);
} | [
"public",
"static",
"void",
"enableProtoStuffSerialization",
"(",
"Configuration",
"conf",
")",
"{",
"String",
"ser",
"=",
"conf",
".",
"get",
"(",
"\"io.serializations\"",
")",
".",
"trim",
"(",
")",
";",
"if",
"(",
"ser",
".",
"length",
"(",
")",
"!=",
... | Enables ProtoStuff Serialization support in Hadoop. | [
"Enables",
"ProtoStuff",
"Serialization",
"support",
"in",
"Hadoop",
"."
] | bfd312dd78cba03febaf7988ae96a3d4bc585408 | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/serialization/ProtoStuffSerialization.java#L128-L136 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java | CloneCommand.execute | public void execute() throws Exception {
String site1 = getSecureBaseUrl(sites.get(0));
String site2 = getSecureBaseUrl(sites.get(1));
if(site1.equalsIgnoreCase(site2)) {
System.err.println("Cannot clone a site into itself.");
System.exit(1);
}
try{
System.out.println("Getting... | java | public void execute() throws Exception {
String site1 = getSecureBaseUrl(sites.get(0));
String site2 = getSecureBaseUrl(sites.get(1));
if(site1.equalsIgnoreCase(site2)) {
System.err.println("Cannot clone a site into itself.");
System.exit(1);
}
try{
System.out.println("Getting... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"Exception",
"{",
"String",
"site1",
"=",
"getSecureBaseUrl",
"(",
"sites",
".",
"get",
"(",
"0",
")",
")",
";",
"String",
"site2",
"=",
"getSecureBaseUrl",
"(",
"sites",
".",
"get",
"(",
"1",
")",
")",
... | Called to execute this command. | [
"Called",
"to",
"execute",
"this",
"command",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java#L70-L107 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java | CloneCommand.checkSendUpdateConfigMessage | private void checkSendUpdateConfigMessage(String site1, String site2,
Status site1Status, Status site2Status) throws Exception {
String repo;
String revision;
String branch;
if(includeConfig) {
repo = site1Status.getConfigRepo();
revision = site1Status.getConfigRevision();
branch... | java | private void checkSendUpdateConfigMessage(String site1, String site2,
Status site1Status, Status site2Status) throws Exception {
String repo;
String revision;
String branch;
if(includeConfig) {
repo = site1Status.getConfigRepo();
revision = site1Status.getConfigRevision();
branch... | [
"private",
"void",
"checkSendUpdateConfigMessage",
"(",
"String",
"site1",
",",
"String",
"site2",
",",
"Status",
"site1Status",
",",
"Status",
"site2Status",
")",
"throws",
"Exception",
"{",
"String",
"repo",
";",
"String",
"revision",
";",
"String",
"branch",
... | Checks if a config update message is necessary and sends it if it is.
@param site1 The source site for the configuration.
@param site2 The target site for the configuration.
@param site1Status The status of the source site.
@param site2Status The status of the target site.
@throws Exception | [
"Checks",
"if",
"a",
"config",
"update",
"message",
"is",
"necessary",
"and",
"sends",
"it",
"if",
"it",
"is",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java#L118-L138 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java | CloneCommand.cloneSiteRepo | public static GitService cloneSiteRepo(Status status) throws Exception {
File tmpDir = File.createTempFile("site", "git");
GitService git = null;
if(tmpDir.delete()) {
try {
git = GitService.cloneRepo(status.getRepo(), tmpDir.getAbsolutePath());
if(status.getBranch() != null && !git.ge... | java | public static GitService cloneSiteRepo(Status status) throws Exception {
File tmpDir = File.createTempFile("site", "git");
GitService git = null;
if(tmpDir.delete()) {
try {
git = GitService.cloneRepo(status.getRepo(), tmpDir.getAbsolutePath());
if(status.getBranch() != null && !git.ge... | [
"public",
"static",
"GitService",
"cloneSiteRepo",
"(",
"Status",
"status",
")",
"throws",
"Exception",
"{",
"File",
"tmpDir",
"=",
"File",
".",
"createTempFile",
"(",
"\"site\"",
",",
"\"git\"",
")",
";",
"GitService",
"git",
"=",
"null",
";",
"if",
"(",
... | Clones a repository locally from a status response from a Cadmium site.
@param status The status response to clone locally.
@return The {@link GitService} object that points to the newly cloned remote repo.
@throws Exception | [
"Clones",
"a",
"repository",
"locally",
"from",
"a",
"status",
"response",
"from",
"a",
"Cadmium",
"site",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/CloneCommand.java#L161-L183 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/CommonLogHolder.java | CommonLogHolder.setEnvironment | public static void setEnvironment(String otEnv, String otEnvType, String otEnvLocation, String otEnvFlavor) {
OT_ENV = otEnv;
OT_ENV_TYPE = otEnvType;
OT_ENV_LOCATION = otEnvLocation;
OT_ENV_FLAVOR = otEnvFlavor;
} | java | public static void setEnvironment(String otEnv, String otEnvType, String otEnvLocation, String otEnvFlavor) {
OT_ENV = otEnv;
OT_ENV_TYPE = otEnvType;
OT_ENV_LOCATION = otEnvLocation;
OT_ENV_FLAVOR = otEnvFlavor;
} | [
"public",
"static",
"void",
"setEnvironment",
"(",
"String",
"otEnv",
",",
"String",
"otEnvType",
",",
"String",
"otEnvLocation",
",",
"String",
"otEnvFlavor",
")",
"{",
"OT_ENV",
"=",
"otEnv",
";",
"OT_ENV_TYPE",
"=",
"otEnvType",
";",
"OT_ENV_LOCATION",
"=",
... | Mock out the environment. You probably don't want to do this. | [
"Mock",
"out",
"the",
"environment",
".",
"You",
"probably",
"don",
"t",
"want",
"to",
"do",
"this",
"."
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/CommonLogHolder.java#L70-L75 | train |
opentable/otj-logging | core/src/main/java/com/opentable/logging/CommonLogHolder.java | CommonLogHolder.getServiceType | public static String getServiceType() {
if (UNSET.equals(serviceType) && WARNED_UNSET.compareAndSet(false, true)) {
LoggerFactory.getLogger(ApplicationLogEvent.class).error("The application name was not set! Sending 'UNSET' instead :(");
}
return serviceType;
} | java | public static String getServiceType() {
if (UNSET.equals(serviceType) && WARNED_UNSET.compareAndSet(false, true)) {
LoggerFactory.getLogger(ApplicationLogEvent.class).error("The application name was not set! Sending 'UNSET' instead :(");
}
return serviceType;
} | [
"public",
"static",
"String",
"getServiceType",
"(",
")",
"{",
"if",
"(",
"UNSET",
".",
"equals",
"(",
"serviceType",
")",
"&&",
"WARNED_UNSET",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"LoggerFactory",
".",
"getLogger",
"(",
"Applic... | Get the service type
@return the type of service | [
"Get",
"the",
"service",
"type"
] | eaa74c877c4721ddb9af8eb7fe1612166f7ac14d | https://github.com/opentable/otj-logging/blob/eaa74c877c4721ddb9af8eb7fe1612166f7ac14d/core/src/main/java/com/opentable/logging/CommonLogHolder.java#L92-L97 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/commands/SyncCommandAction.java | SyncCommandAction.isEmptyOrNull | private static boolean isEmptyOrNull( GitLocation location ) {
return location == null ||
(StringUtils.isEmptyOrNull(location.getRepository()) &&
StringUtils.isEmptyOrNull(location.getBranch()) &&
StringUtils.isEmptyOrNull(location.getRevision()));
} | java | private static boolean isEmptyOrNull( GitLocation location ) {
return location == null ||
(StringUtils.isEmptyOrNull(location.getRepository()) &&
StringUtils.isEmptyOrNull(location.getBranch()) &&
StringUtils.isEmptyOrNull(location.getRevision()));
} | [
"private",
"static",
"boolean",
"isEmptyOrNull",
"(",
"GitLocation",
"location",
")",
"{",
"return",
"location",
"==",
"null",
"||",
"(",
"StringUtils",
".",
"isEmptyOrNull",
"(",
"location",
".",
"getRepository",
"(",
")",
")",
"&&",
"StringUtils",
".",
"isEm... | Returns true if a git location object is null or all of its values are
empty or null.
@param location the location object to test.
@return true if the git location object is null or all of its values are empty or null, false otherwise. | [
"Returns",
"true",
"if",
"a",
"git",
"location",
"object",
"is",
"null",
"or",
"all",
"of",
"its",
"values",
"are",
"empty",
"or",
"null",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/commands/SyncCommandAction.java#L300-L305 | train |
EXIficient/exificient-core | src/main/java/com/siemens/ct/exi/core/coder/EXIHeaderEncoder.java | EXIHeaderEncoder.write | public void write(BitEncoderChannel headerChannel, EXIFactory f)
throws EXIException {
try {
EncodingOptions headerOptions = f.getEncodingOptions();
CodingMode codingMode = f.getCodingMode();
// EXI Cookie
if (headerOptions.isOptionEnabled(EncodingOptions.INCLUDE_COOKIE)) {
// four byte field cons... | java | public void write(BitEncoderChannel headerChannel, EXIFactory f)
throws EXIException {
try {
EncodingOptions headerOptions = f.getEncodingOptions();
CodingMode codingMode = f.getCodingMode();
// EXI Cookie
if (headerOptions.isOptionEnabled(EncodingOptions.INCLUDE_COOKIE)) {
// four byte field cons... | [
"public",
"void",
"write",
"(",
"BitEncoderChannel",
"headerChannel",
",",
"EXIFactory",
"f",
")",
"throws",
"EXIException",
"{",
"try",
"{",
"EncodingOptions",
"headerOptions",
"=",
"f",
".",
"getEncodingOptions",
"(",
")",
";",
"CodingMode",
"codingMode",
"=",
... | Writes the EXI header according to the header options with optional
cookie, EXI options, ..
@param headerChannel
header channel
@param f
factory
@throws EXIException
EXI exception | [
"Writes",
"the",
"EXI",
"header",
"according",
"to",
"the",
"header",
"options",
"with",
"optional",
"cookie",
"EXI",
"options",
".."
] | b6026c5fd39e9cc3d7874caa20f084e264e0ddc7 | https://github.com/EXIficient/exificient-core/blob/b6026c5fd39e9cc3d7874caa20f084e264e0ddc7/src/main/java/com/siemens/ct/exi/core/coder/EXIHeaderEncoder.java#L74-L116 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java | MessageConverter.toJGroupsMessage | public org.jgroups.Message toJGroupsMessage(Message<?> cMessage) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
JsonGenerator generator = factory.createJsonGenerator(out);
generator.writeStartObject();
generator.writeObjectField("header", cMessage.getHeader());
if( cMe... | java | public org.jgroups.Message toJGroupsMessage(Message<?> cMessage) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
JsonGenerator generator = factory.createJsonGenerator(out);
generator.writeStartObject();
generator.writeObjectField("header", cMessage.getHeader());
if( cMe... | [
"public",
"org",
".",
"jgroups",
".",
"Message",
"toJGroupsMessage",
"(",
"Message",
"<",
"?",
">",
"cMessage",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"JsonGenerator",
"generator",
"... | Serialized the cadmium message object into JSON and returns it as a JGroups message.
@param cMessage the cadmium message to convert.
@return The JGroups message containing the JSON string of the cadmium message.
@throws IOException if there is a problem serializing the message. | [
"Serialized",
"the",
"cadmium",
"message",
"object",
"into",
"JSON",
"and",
"returns",
"it",
"as",
"a",
"JGroups",
"message",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java#L69-L83 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java | MessageConverter.toCadmiumMessage | public <B> Message<B> toCadmiumMessage(org.jgroups.Message jgMessage) throws JsonProcessingException, IOException {
JsonParser parser = factory.createJsonParser(jgMessage.getBuffer());
parser.nextToken(); // parse the start token for the document.
parser.nextToken(); // parse the field name
parser.nextT... | java | public <B> Message<B> toCadmiumMessage(org.jgroups.Message jgMessage) throws JsonProcessingException, IOException {
JsonParser parser = factory.createJsonParser(jgMessage.getBuffer());
parser.nextToken(); // parse the start token for the document.
parser.nextToken(); // parse the field name
parser.nextT... | [
"public",
"<",
"B",
">",
"Message",
"<",
"B",
">",
"toCadmiumMessage",
"(",
"org",
".",
"jgroups",
".",
"Message",
"jgMessage",
")",
"throws",
"JsonProcessingException",
",",
"IOException",
"{",
"JsonParser",
"parser",
"=",
"factory",
".",
"createJsonParser",
... | Deserializes the JSON content of a JGroups message into a cadmium message.
@param jgMessage the JGroups message containing the JSON to deserialize.
@return the deserialized cadmium message.
@throws JsonProcessingException if the JSON was malformed.
@throws IOException if an IO problem is encountered. | [
"Deserializes",
"the",
"JSON",
"content",
"of",
"a",
"JGroups",
"message",
"into",
"a",
"cadmium",
"message",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java#L92-L124 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java | MessageConverter.lookupBodyClass | private Class<?> lookupBodyClass(Header header) throws IOException {
if( header == null ) throw new IOException("Could not deserialize message body: no header.");
if( header.getCommand() == null ) throw new IOException("Could not deserialize message body: no command declared.");
Class<?> commandBodyClass = ... | java | private Class<?> lookupBodyClass(Header header) throws IOException {
if( header == null ) throw new IOException("Could not deserialize message body: no header.");
if( header.getCommand() == null ) throw new IOException("Could not deserialize message body: no command declared.");
Class<?> commandBodyClass = ... | [
"private",
"Class",
"<",
"?",
">",
"lookupBodyClass",
"(",
"Header",
"header",
")",
"throws",
"IOException",
"{",
"if",
"(",
"header",
"==",
"null",
")",
"throw",
"new",
"IOException",
"(",
"\"Could not deserialize message body: no header.\"",
")",
";",
"if",
"(... | Looks up the body type for a message based on the command in the specified header object.
@param header the header object for the message.
@return the type of the body message.
@throws IOException if there is a problem looking up the class. | [
"Looks",
"up",
"the",
"body",
"type",
"for",
"a",
"message",
"based",
"on",
"the",
"command",
"in",
"the",
"specified",
"header",
"object",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/messaging/MessageConverter.java#L133-L139 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/UpdateCommand.java | UpdateCommand.isValidBranchName | public static boolean isValidBranchName(String branch, String prefix) throws Exception {
if(StringUtils.isNotBlank(prefix) && StringUtils.isNotBlank(branch)) {
if(StringUtils.startsWithIgnoreCase(branch, prefix + "-")) {
return true;
} else {
System.err.println("Branch name must start wi... | java | public static boolean isValidBranchName(String branch, String prefix) throws Exception {
if(StringUtils.isNotBlank(prefix) && StringUtils.isNotBlank(branch)) {
if(StringUtils.startsWithIgnoreCase(branch, prefix + "-")) {
return true;
} else {
System.err.println("Branch name must start wi... | [
"public",
"static",
"boolean",
"isValidBranchName",
"(",
"String",
"branch",
",",
"String",
"prefix",
")",
"throws",
"Exception",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"prefix",
")",
"&&",
"StringUtils",
".",
"isNotBlank",
"(",
"branch",
")",
... | Validates the branch name that will be sent to the given prefix.
@param branch
@param prefix
@return | [
"Validates",
"the",
"branch",
"name",
"that",
"will",
"be",
"sent",
"to",
"the",
"given",
"prefix",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/UpdateCommand.java#L253-L264 | train |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/internal/EmailServiceImpl.java | EmailServiceImpl.configurationUpdated | public void configurationUpdated(Object emailConfig) {
EmailConfiguration config = (EmailConfiguration) emailConfig;
if(config != null && (this.config == null || !config.equals(this.config))) {
log.info("Updating configuration for email.");
this.config = config;
//Set the capt... | java | public void configurationUpdated(Object emailConfig) {
EmailConfiguration config = (EmailConfiguration) emailConfig;
if(config != null && (this.config == null || !config.equals(this.config))) {
log.info("Updating configuration for email.");
this.config = config;
//Set the capt... | [
"public",
"void",
"configurationUpdated",
"(",
"Object",
"emailConfig",
")",
"{",
"EmailConfiguration",
"config",
"=",
"(",
"EmailConfiguration",
")",
"emailConfig",
";",
"if",
"(",
"config",
"!=",
"null",
"&&",
"(",
"this",
".",
"config",
"==",
"null",
"||",
... | Updates the Email Service component configuration. | [
"Updates",
"the",
"Email",
"Service",
"component",
"configuration",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/internal/EmailServiceImpl.java#L69-L126 | train |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/internal/EmailServiceImpl.java | EmailServiceImpl.send | public void send(Email email) throws EmailException {
synchronized (this) {
EmailConnection connection = openConnection();
connection.connect();
connection.send(email);
connection.close();
}
} | java | public void send(Email email) throws EmailException {
synchronized (this) {
EmailConnection connection = openConnection();
connection.connect();
connection.send(email);
connection.close();
}
} | [
"public",
"void",
"send",
"(",
"Email",
"email",
")",
"throws",
"EmailException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"EmailConnection",
"connection",
"=",
"openConnection",
"(",
")",
";",
"connection",
".",
"connect",
"(",
")",
";",
"connection",
".... | Opens a connection, sends the email, then closes the connection
@param email the email to send | [
"Opens",
"a",
"connection",
"sends",
"the",
"email",
"then",
"closes",
"the",
"connection"
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/internal/EmailServiceImpl.java#L191-L200 | train |
meltmedia/cadmium | cli/src/main/java/com/meltmedia/cadmium/cli/WarInfoCommand.java | WarInfoCommand.getDeployedWarInfo | public static WarInfo getDeployedWarInfo(String url, String warName, String token) throws Exception {
HttpClient client = httpClient();
HttpGet get = new HttpGet(url + "/system/deployment/details/"+warName);
addAuthHeader(token, get);
HttpResponse resp = client.execute(get);
if(resp.g... | java | public static WarInfo getDeployedWarInfo(String url, String warName, String token) throws Exception {
HttpClient client = httpClient();
HttpGet get = new HttpGet(url + "/system/deployment/details/"+warName);
addAuthHeader(token, get);
HttpResponse resp = client.execute(get);
if(resp.g... | [
"public",
"static",
"WarInfo",
"getDeployedWarInfo",
"(",
"String",
"url",
",",
"String",
"warName",
",",
"String",
"token",
")",
"throws",
"Exception",
"{",
"HttpClient",
"client",
"=",
"httpClient",
"(",
")",
";",
"HttpGet",
"get",
"=",
"new",
"HttpGet",
"... | Retrieves information about a deployed cadmium war.
@param url The uri to a Cadmium deployer war.
@param warName The name of a deployed war.
@param token The Github API token used for authentication.
@return
@throws Exception | [
"Retrieves",
"information",
"about",
"a",
"deployed",
"cadmium",
"war",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/cli/src/main/java/com/meltmedia/cadmium/cli/WarInfoCommand.java#L102-L116 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/config/impl/YamlConfigurationParser.java | YamlConfigurationParser.mergeConfigs | @SuppressWarnings("unchecked")
private void mergeConfigs(Map<String, Map<String, ?>> configurationMap,
Object parsed) {
if(parsed instanceof Map) {
Map<?, ?> parsedMap = (Map<?, ?>) parsed;
for(Object key : parsedMap.keySet()) {
if(key instanceof String) {
Map<String, Object> e... | java | @SuppressWarnings("unchecked")
private void mergeConfigs(Map<String, Map<String, ?>> configurationMap,
Object parsed) {
if(parsed instanceof Map) {
Map<?, ?> parsedMap = (Map<?, ?>) parsed;
for(Object key : parsedMap.keySet()) {
if(key instanceof String) {
Map<String, Object> e... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"mergeConfigs",
"(",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"?",
">",
">",
"configurationMap",
",",
"Object",
"parsed",
")",
"{",
"if",
"(",
"parsed",
"instanceof",
"Map"... | Merges configurations from an Object into an existing Map.
@param configurationMap
@param parsed | [
"Merges",
"configurations",
"from",
"an",
"Object",
"into",
"an",
"existing",
"Map",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/config/impl/YamlConfigurationParser.java#L121-L145 | train |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/config/impl/YamlConfigurationParser.java | YamlConfigurationParser.getEnvConfig | private <T> T getEnvConfig(Map<String, ?> configs, String key, Class<T> type) {
if(configs.containsKey(key)) {
Object config = configs.get(key);
if(type.isAssignableFrom(config.getClass())) {
return type.cast(config);
}
}
return null;
} | java | private <T> T getEnvConfig(Map<String, ?> configs, String key, Class<T> type) {
if(configs.containsKey(key)) {
Object config = configs.get(key);
if(type.isAssignableFrom(config.getClass())) {
return type.cast(config);
}
}
return null;
} | [
"private",
"<",
"T",
">",
"T",
"getEnvConfig",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"configs",
",",
"String",
"key",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"configs",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Object"... | Helper method used to retrieve the value from a given map if it matches the type specified.
@param configs The map to pull from.
@param key The key to pull.
@param type The expected type of the value.
@return | [
"Helper",
"method",
"used",
"to",
"retrieve",
"the",
"value",
"from",
"a",
"given",
"map",
"if",
"it",
"matches",
"the",
"type",
"specified",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/config/impl/YamlConfigurationParser.java#L201-L209 | train |
meltmedia/cadmium | persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java | CadmiumPersistenceProvider.createEntityManagerFactory | @SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createEntityManagerFactory(String emName, Map properties) {
PersistenceUnitInfo pUnit = new CadmiumPersistenceUnitInfo() ;
return createContainerEntityManagerFactory(pUnit, properties);
} | java | @SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createEntityManagerFactory(String emName, Map properties) {
PersistenceUnitInfo pUnit = new CadmiumPersistenceUnitInfo() ;
return createContainerEntityManagerFactory(pUnit, properties);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"public",
"EntityManagerFactory",
"createEntityManagerFactory",
"(",
"String",
"emName",
",",
"Map",
"properties",
")",
"{",
"PersistenceUnitInfo",
"pUnit",
"=",
"new",
"CadmiumPersistenceUnitInfo",
"("... | Uses Hibernate's Reflections and the properties map to override defaults to create a
EntityManagerFactory without the need of any persistence.xml file. | [
"Uses",
"Hibernate",
"s",
"Reflections",
"and",
"the",
"properties",
"map",
"to",
"override",
"defaults",
"to",
"create",
"a",
"EntityManagerFactory",
"without",
"the",
"need",
"of",
"any",
"persistence",
".",
"xml",
"file",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java#L91-L96 | train |
meltmedia/cadmium | persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java | CadmiumPersistenceProvider.createContainerEntityManagerFactory | @SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createContainerEntityManagerFactory(
PersistenceUnitInfo info, Map properties) {
EntityManagerFactory factory = wrappedPersistenceProvider.createContainerEntityManagerFactory(info, properties);
return factory;
} | java | @SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createContainerEntityManagerFactory(
PersistenceUnitInfo info, Map properties) {
EntityManagerFactory factory = wrappedPersistenceProvider.createContainerEntityManagerFactory(info, properties);
return factory;
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"@",
"Override",
"public",
"EntityManagerFactory",
"createContainerEntityManagerFactory",
"(",
"PersistenceUnitInfo",
"info",
",",
"Map",
"properties",
")",
"{",
"EntityManagerFactory",
"factory",
"=",
"wrappedPersistencePr... | This just delegates to the HibernatePersistence method. | [
"This",
"just",
"delegates",
"to",
"the",
"HibernatePersistence",
"method",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/persistence/src/main/java/com/meltmedia/cadmium/persistence/CadmiumPersistenceProvider.java#L101-L107 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java | AuthenticationManagerService.getConfigurableUsers | @GET
public Response getConfigurableUsers(@HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != null ) {
List<String> usernames = new ArrayList<String>();
usernames = realm.lis... | java | @GET
public Response getConfigurableUsers(@HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != null ) {
List<String> usernames = new ArrayList<String>();
usernames = realm.lis... | [
"@",
"GET",
"public",
"Response",
"getConfigurableUsers",
"(",
"@",
"HeaderParam",
"(",
"\"Authorization\"",
")",
"@",
"DefaultValue",
"(",
"\"no token\"",
")",
"String",
"auth",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"this",
".",
"isAuth",
"(",
"a... | Returns a list of users specific to this site only.
@param auth
@return
@throws Exception | [
"Returns",
"a",
"list",
"of",
"users",
"specific",
"to",
"this",
"site",
"only",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java#L64-L75 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java | AuthenticationManagerService.addUser | @PUT
@Path("{user}")
@Consumes(MediaType.TEXT_PLAIN)
public Response addUser(@PathParam("user") String username, @HeaderParam("Authorization") @DefaultValue("no token") String auth, String message) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != n... | java | @PUT
@Path("{user}")
@Consumes(MediaType.TEXT_PLAIN)
public Response addUser(@PathParam("user") String username, @HeaderParam("Authorization") @DefaultValue("no token") String auth, String message) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != n... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"{user}\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"TEXT_PLAIN",
")",
"public",
"Response",
"addUser",
"(",
"@",
"PathParam",
"(",
"\"user\"",
")",
"String",
"username",
",",
"@",
"HeaderParam",
"(",
"\"Authorization\"",... | Adds user credentials for access to this site only.
@param username
@param auth
@param message
@return
@throws Exception | [
"Adds",
"user",
"credentials",
"for",
"access",
"to",
"this",
"site",
"only",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java#L86-L103 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java | AuthenticationManagerService.deleteUser | @DELETE
@Path("{user}")
public Response deleteUser(@PathParam("user") String username, @HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != null ){
AuthenticationManagerRequest re... | java | @DELETE
@Path("{user}")
public Response deleteUser(@PathParam("user") String username, @HeaderParam("Authorization") @DefaultValue("no token") String auth) throws Exception {
if(!this.isAuth(auth)) {
throw new Exception("Unauthorized!");
}
if( realm != null ){
AuthenticationManagerRequest re... | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"{user}\"",
")",
"public",
"Response",
"deleteUser",
"(",
"@",
"PathParam",
"(",
"\"user\"",
")",
"String",
"username",
",",
"@",
"HeaderParam",
"(",
"\"Authorization\"",
")",
"@",
"DefaultValue",
"(",
"\"no token\"",
")",
... | Deletes an user from the user acounts specific to this site only.
@param username
@param auth
@return
@throws Exception | [
"Deletes",
"an",
"user",
"from",
"the",
"user",
"acounts",
"specific",
"to",
"this",
"site",
"only",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java#L112-L127 | train |
meltmedia/cadmium | servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java | AuthenticationManagerService.sendMessage | private void sendMessage(AuthenticationManagerRequest req) {
Message<AuthenticationManagerRequest> msg = new Message<AuthenticationManagerRequest>(AuthenticationManagerCommandAction.COMMAND_NAME, req);
try {
sender.sendMessage(msg, null);
} catch (Exception e) {
log.error("Failed to update authe... | java | private void sendMessage(AuthenticationManagerRequest req) {
Message<AuthenticationManagerRequest> msg = new Message<AuthenticationManagerRequest>(AuthenticationManagerCommandAction.COMMAND_NAME, req);
try {
sender.sendMessage(msg, null);
} catch (Exception e) {
log.error("Failed to update authe... | [
"private",
"void",
"sendMessage",
"(",
"AuthenticationManagerRequest",
"req",
")",
"{",
"Message",
"<",
"AuthenticationManagerRequest",
">",
"msg",
"=",
"new",
"Message",
"<",
"AuthenticationManagerRequest",
">",
"(",
"AuthenticationManagerCommandAction",
".",
"COMMAND_NA... | Generically send a JGroups message to the cluster.
@param req | [
"Generically",
"send",
"a",
"JGroups",
"message",
"to",
"the",
"cluster",
"."
] | bca585030e141803a73b58abb128d130157b6ddf | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/servlets/src/main/java/com/meltmedia/cadmium/servlets/jersey/AuthenticationManagerService.java#L134-L141 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.