id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
100,100 | Stratio/bdt | src/main/java/com/stratio/qa/specs/CommonG.java | CommonG.matchJsonToSchema | public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception {
SchemaLoader.builder()
.useDefaults(true)
.schemaJson(schema)
.build()
.load()
.build()
.validate(json);
return tr... | java | public boolean matchJsonToSchema(JSONObject schema, JSONObject json) throws Exception {
SchemaLoader.builder()
.useDefaults(true)
.schemaJson(schema)
.build()
.load()
.build()
.validate(json);
return tr... | [
"public",
"boolean",
"matchJsonToSchema",
"(",
"JSONObject",
"schema",
",",
"JSONObject",
"json",
")",
"throws",
"Exception",
"{",
"SchemaLoader",
".",
"builder",
"(",
")",
".",
"useDefaults",
"(",
"true",
")",
".",
"schemaJson",
"(",
"schema",
")",
".",
"bu... | Check json matches schema
@param schema schema obtained from deploy-api
@param json json to be checked
@return boolean whether the json matches the schema or not | [
"Check",
"json",
"matches",
"schema"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/CommonG.java#L2242-L2251 |
100,101 | Stratio/bdt | src/main/java/com/stratio/qa/assertions/SeleniumAssert.java | SeleniumAssert.assertThat | public static SeleniumAssert assertThat(CommonG commong, List<WebElement> actual) {
return new SeleniumAssert(commong, actual);
} | java | public static SeleniumAssert assertThat(CommonG commong, List<WebElement> actual) {
return new SeleniumAssert(commong, actual);
} | [
"public",
"static",
"SeleniumAssert",
"assertThat",
"(",
"CommonG",
"commong",
",",
"List",
"<",
"WebElement",
">",
"actual",
")",
"{",
"return",
"new",
"SeleniumAssert",
"(",
"commong",
",",
"actual",
")",
";",
"}"
] | Checks a selenium list of WebElements.
@param commong common object that contains relevant execution info
@param actual webElement used in assert
@return SeleniumAssert | [
"Checks",
"a",
"selenium",
"list",
"of",
"WebElements",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/assertions/SeleniumAssert.java#L205-L207 |
100,102 | Stratio/bdt | src/main/java/com/stratio/qa/assertions/SeleniumAssert.java | SeleniumAssert.contains | public SeleniumAssert contains(CharSequence... values) {
if (actual instanceof WebDriver) {
Strings.instance().assertContains(info,
((WebDriver) actual).getPageSource(), values);
} else if (actual instanceof WebElement) {
Strings.instance().assertContains(info... | java | public SeleniumAssert contains(CharSequence... values) {
if (actual instanceof WebDriver) {
Strings.instance().assertContains(info,
((WebDriver) actual).getPageSource(), values);
} else if (actual instanceof WebElement) {
Strings.instance().assertContains(info... | [
"public",
"SeleniumAssert",
"contains",
"(",
"CharSequence",
"...",
"values",
")",
"{",
"if",
"(",
"actual",
"instanceof",
"WebDriver",
")",
"{",
"Strings",
".",
"instance",
"(",
")",
".",
"assertContains",
"(",
"info",
",",
"(",
"(",
"WebDriver",
")",
"ac... | Checks if a webDriver or WebElement has values.
@param values char sequence compared
@return SeleniumAssert | [
"Checks",
"if",
"a",
"webDriver",
"or",
"WebElement",
"has",
"values",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/assertions/SeleniumAssert.java#L246-L255 |
100,103 | Stratio/bdt | src/main/java/com/stratio/qa/assertions/SeleniumAssert.java | SeleniumAssert.isTextField | public SeleniumAssert isTextField(Condition<WebElement> cond) {
if (actual instanceof List) {
Conditions.instance().equals(cond);
}
return this;
} | java | public SeleniumAssert isTextField(Condition<WebElement> cond) {
if (actual instanceof List) {
Conditions.instance().equals(cond);
}
return this;
} | [
"public",
"SeleniumAssert",
"isTextField",
"(",
"Condition",
"<",
"WebElement",
">",
"cond",
")",
"{",
"if",
"(",
"actual",
"instanceof",
"List",
")",
"{",
"Conditions",
".",
"instance",
"(",
")",
".",
"equals",
"(",
"cond",
")",
";",
"}",
"return",
"thi... | Checks if a WebElement is a TextField.
@param cond webElement used in condition
@return SeleniumAssert | [
"Checks",
"if",
"a",
"WebElement",
"is",
"a",
"TextField",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/assertions/SeleniumAssert.java#L264-L269 |
100,104 | Stratio/bdt | src/main/java/com/stratio/qa/specs/FileSpec.java | FileSpec.readFromCSV | @When("^I read info from csv file '(.+?)' with separator '(.+?)'$")
public void readFromCSV(String csvFile, String separator) throws Exception {
//By default separator is a coma
char sep = ',';
if (separator.length() > 1) {
switch (separator) {
case "\\t":
... | java | @When("^I read info from csv file '(.+?)' with separator '(.+?)'$")
public void readFromCSV(String csvFile, String separator) throws Exception {
//By default separator is a coma
char sep = ',';
if (separator.length() > 1) {
switch (separator) {
case "\\t":
... | [
"@",
"When",
"(",
"\"^I read info from csv file '(.+?)' with separator '(.+?)'$\"",
")",
"public",
"void",
"readFromCSV",
"(",
"String",
"csvFile",
",",
"String",
"separator",
")",
"throws",
"Exception",
"{",
"//By default separator is a coma",
"char",
"sep",
"=",
"'",
... | Read csv file and store result in list of maps
@param csvFile | [
"Read",
"csv",
"file",
"and",
"store",
"result",
"in",
"list",
"of",
"maps"
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/FileSpec.java#L48-L86 |
100,105 | Stratio/bdt | src/main/java/com/stratio/qa/specs/FileSpec.java | FileSpec.readFileToVariable | @When("^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)' with:$")
public void readFileToVariable(String baseData, String type, String envVar, DataTable modifications) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
... | java | @When("^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)' with:$")
public void readFileToVariable(String baseData, String type, String envVar, DataTable modifications) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
... | [
"@",
"When",
"(",
"\"^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)' with:$\"",
")",
"public",
"void",
"readFileToVariable",
"(",
"String",
"baseData",
",",
"String",
"type",
",",
"String",
"envVar",
",",
"DataTable",
"modifications",
")",
"throw... | Read the file passed as parameter, perform the modifications specified and save the result in the environment
variable passed as parameter.
@param baseData file to read
@param type whether the info in the file is a 'json' or a simple 'string'
@param envVar name of the variable where to store the r... | [
"Read",
"the",
"file",
"passed",
"as",
"parameter",
"perform",
"the",
"modifications",
"specified",
"and",
"save",
"the",
"result",
"in",
"the",
"environment",
"variable",
"passed",
"as",
"parameter",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/FileSpec.java#L171-L182 |
100,106 | Stratio/bdt | src/main/java/com/stratio/qa/specs/FileSpec.java | FileSpec.readFileToVariableNoDataTable | @When("^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)'$")
public void readFileToVariableNoDataTable(String baseData, String type, String envVar) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
// Save in environ... | java | @When("^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)'$")
public void readFileToVariableNoDataTable(String baseData, String type, String envVar) throws Exception {
// Retrieve data
String retrievedData = commonspec.retrieveData(baseData, type);
// Save in environ... | [
"@",
"When",
"(",
"\"^I read file '(.+?)' as '(.+?)' and save it in environment variable '(.+?)'$\"",
")",
"public",
"void",
"readFileToVariableNoDataTable",
"(",
"String",
"baseData",
",",
"String",
"type",
",",
"String",
"envVar",
")",
"throws",
"Exception",
"{",
"// Retr... | Read the file passed as parameter and save the result in the environment
variable passed as parameter.
@param baseData file to read
@param type whether the info in the file is a 'json' or a simple 'string'
@param envVar name of the variable where to store the result | [
"Read",
"the",
"file",
"passed",
"as",
"parameter",
"and",
"save",
"the",
"result",
"in",
"the",
"environment",
"variable",
"passed",
"as",
"parameter",
"."
] | 55324d19e7497764ad3dd7139923e13eb9841d75 | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/FileSpec.java#L192-L199 |
100,107 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ClipboardUtils.java | ClipboardUtils.getClipboardText | public static String getClipboardText(final Context context) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
final ClipData clipData = clipboard.getPrimaryClip();
if(clipData != null && clipData.getItemCount() > 0) {
final ... | java | public static String getClipboardText(final Context context) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
final ClipData clipData = clipboard.getPrimaryClip();
if(clipData != null && clipData.getItemCount() > 0) {
final ... | [
"public",
"static",
"String",
"getClipboardText",
"(",
"final",
"Context",
"context",
")",
"{",
"final",
"ClipboardManager",
"clipboard",
"=",
"(",
"ClipboardManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"CLIPBOARD_SERVICE",
")",
";",
"fi... | Get the current text from the clipboard.
@return Clipboard text or {@code null} if clipboard is empty or unavailable. | [
"Get",
"the",
"current",
"text",
"from",
"the",
"clipboard",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ClipboardUtils.java#L17-L27 |
100,108 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ClipboardUtils.java | ClipboardUtils.setClipboardText | public static void setClipboardText(final Context context, final String text) {
if(text != null) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
final ClipData clipData = ClipData.newPlainText(text, text);
clipboard... | java | public static void setClipboardText(final Context context, final String text) {
if(text != null) {
final ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
final ClipData clipData = ClipData.newPlainText(text, text);
clipboard... | [
"public",
"static",
"void",
"setClipboardText",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"text",
")",
"{",
"if",
"(",
"text",
"!=",
"null",
")",
"{",
"final",
"ClipboardManager",
"clipboard",
"=",
"(",
"ClipboardManager",
")",
"context",
"... | Set the clipboard text.
@param text Text to put in the clipboard. | [
"Set",
"the",
"clipboard",
"text",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ClipboardUtils.java#L34-L40 |
100,109 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.closeKeyboard | public static void closeKeyboard(Context context, View field) {
try {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(field.getWindowToken(), 0);
} catch (Exception ex) {
Log.e("Caffeine... | java | public static void closeKeyboard(Context context, View field) {
try {
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(field.getWindowToken(), 0);
} catch (Exception ex) {
Log.e("Caffeine... | [
"public",
"static",
"void",
"closeKeyboard",
"(",
"Context",
"context",
",",
"View",
"field",
")",
"{",
"try",
"{",
"InputMethodManager",
"imm",
"=",
"(",
"InputMethodManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"INPUT_METHOD_SERVICE",
... | Go away keyboard, nobody likes you.
@param context The current Context or Activity that this method is called from.
@param field field that holds the keyboard focus. | [
"Go",
"away",
"keyboard",
"nobody",
"likes",
"you",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L141-L148 |
100,110 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.showKeyboard | public static void showKeyboard(Context context, View field){
try {
field.requestFocus();
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(field, InputMethodManager.SHOW_IMPLICIT);
} catch (Excepti... | java | public static void showKeyboard(Context context, View field){
try {
field.requestFocus();
InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(field, InputMethodManager.SHOW_IMPLICIT);
} catch (Excepti... | [
"public",
"static",
"void",
"showKeyboard",
"(",
"Context",
"context",
",",
"View",
"field",
")",
"{",
"try",
"{",
"field",
".",
"requestFocus",
"(",
")",
";",
"InputMethodManager",
"imm",
"=",
"(",
"InputMethodManager",
")",
"context",
".",
"getSystemService"... | Show the pop-up keyboard
@param context Activity/Context.
@param field field that requests focus. | [
"Show",
"the",
"pop",
"-",
"up",
"keyboard"
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L156-L164 |
100,111 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java | ViewUtils.viewToImage | public static Bitmap viewToImage(Context context, WebView viewToBeConverted) {
int extraSpace = 2000; //because getContentHeight doesn't always return the full screen height.
int height = viewToBeConverted.getContentHeight() + extraSpace;
Bitmap viewBitmap = Bitmap.createBitmap(viewToBeConverte... | java | public static Bitmap viewToImage(Context context, WebView viewToBeConverted) {
int extraSpace = 2000; //because getContentHeight doesn't always return the full screen height.
int height = viewToBeConverted.getContentHeight() + extraSpace;
Bitmap viewBitmap = Bitmap.createBitmap(viewToBeConverte... | [
"public",
"static",
"Bitmap",
"viewToImage",
"(",
"Context",
"context",
",",
"WebView",
"viewToBeConverted",
")",
"{",
"int",
"extraSpace",
"=",
"2000",
";",
"//because getContentHeight doesn't always return the full screen height.",
"int",
"height",
"=",
"viewToBeConverted... | Convert view to an image. Can be used to make animations smoother.
@param context The current Context or Activity that this method is called from.
@param viewToBeConverted View to convert to a Bitmap.
@return Bitmap object that can be put in an ImageView. Will look like the converted viewToBeConverted. | [
"Convert",
"view",
"to",
"an",
"image",
".",
"Can",
"be",
"used",
"to",
"make",
"animations",
"smoother",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ViewUtils.java#L173-L192 |
100,112 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.launchWebBrowser | public static void launchWebBrowser(final Context context, final String url) {
if (context != null && url != null && !"".equals(url)) {
final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
if (browserIntent.resolveActivity(context.getPackageManager()) != null) {
... | java | public static void launchWebBrowser(final Context context, final String url) {
if (context != null && url != null && !"".equals(url)) {
final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
if (browserIntent.resolveActivity(context.getPackageManager()) != null) {
... | [
"public",
"static",
"void",
"launchWebBrowser",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"url",
")",
"{",
"if",
"(",
"context",
"!=",
"null",
"&&",
"url",
"!=",
"null",
"&&",
"!",
"\"\"",
".",
"equals",
"(",
"url",
")",
")",
"{",
"... | Start Intent to launch web browser. | [
"Start",
"Intent",
"to",
"launch",
"web",
"browser",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L37-L49 |
100,113 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.isAppInstalled | public static boolean isAppInstalled(final Context context, final String packageName){
try {
context.getPackageManager().getPackageInfo(packageName, 0);
return true;
} catch (Exception e) {
return false;
}
} | java | public static boolean isAppInstalled(final Context context, final String packageName){
try {
context.getPackageManager().getPackageInfo(packageName, 0);
return true;
} catch (Exception e) {
return false;
}
} | [
"public",
"static",
"boolean",
"isAppInstalled",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"packageName",
")",
"{",
"try",
"{",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getPackageInfo",
"(",
"packageName",
",",
"0",
")",
";",
"r... | Check if app for the given package name is installed on this device. | [
"Check",
"if",
"app",
"for",
"the",
"given",
"package",
"name",
"is",
"installed",
"on",
"this",
"device",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L54-L61 |
100,114 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.launchCameraIntent | public static void launchCameraIntent(final Activity context, final Uri outputDestination, final int requestCode){
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputDestination);
if (intent.resolveActivity(context.getPackageManager(... | java | public static void launchCameraIntent(final Activity context, final Uri outputDestination, final int requestCode){
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputDestination);
if (intent.resolveActivity(context.getPackageManager(... | [
"public",
"static",
"void",
"launchCameraIntent",
"(",
"final",
"Activity",
"context",
",",
"final",
"Uri",
"outputDestination",
",",
"final",
"int",
"requestCode",
")",
"{",
"final",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"MediaStore",
".",
"ACTION_IMAG... | Launch camera on the device using android's ACTION_IMAGE_CAPTURE intent.
@param outputDestination Save image to this location. | [
"Launch",
"camera",
"on",
"the",
"device",
"using",
"android",
"s",
"ACTION_IMAGE_CAPTURE",
"intent",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L67-L74 |
100,115 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java | IntentUtils.launchAppForPackage | public static boolean launchAppForPackage(final Context context, final String packageName) {
try {
final PackageManager packageManager = context.getPackageManager();
final Intent intent = packageManager.getLaunchIntentForPackage(packageName);
intent.addCategory(Intent.CATEGOR... | java | public static boolean launchAppForPackage(final Context context, final String packageName) {
try {
final PackageManager packageManager = context.getPackageManager();
final Intent intent = packageManager.getLaunchIntentForPackage(packageName);
intent.addCategory(Intent.CATEGOR... | [
"public",
"static",
"boolean",
"launchAppForPackage",
"(",
"final",
"Context",
"context",
",",
"final",
"String",
"packageName",
")",
"{",
"try",
"{",
"final",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"final",
... | Tries to launch the application for a given package name.
@return true if launch succeeded, otherwise false. | [
"Tries",
"to",
"launch",
"the",
"application",
"for",
"a",
"given",
"package",
"name",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/IntentUtils.java#L94-L105 |
100,116 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java | ActivityUtils.launchActivity | public static void launchActivity(Activity context, Class<? extends Activity> activity, boolean closeCurrentActivity, Map<String, String> params) {
Intent intent = new Intent(context, activity);
if (params != null) {
Bundle bundle = new Bundle();
for (Entry<String, String> param... | java | public static void launchActivity(Activity context, Class<? extends Activity> activity, boolean closeCurrentActivity, Map<String, String> params) {
Intent intent = new Intent(context, activity);
if (params != null) {
Bundle bundle = new Bundle();
for (Entry<String, String> param... | [
"public",
"static",
"void",
"launchActivity",
"(",
"Activity",
"context",
",",
"Class",
"<",
"?",
"extends",
"Activity",
">",
"activity",
",",
"boolean",
"closeCurrentActivity",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"Intent",
"in... | Launch an Activity.
@param context The current Context or Activity that this method is called from.
@param activity The new Activity to open.
@param closeCurrentActivity whether or not the current activity should close.
@param params Parameters to add to the intent as a Bundle. | [
"Launch",
"an",
"Activity",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java#L30-L45 |
100,117 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java | ActivityUtils.turnScreenOn | public static void turnScreenOn(Activity context) {
try {
Window window = context.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.addFlags(WindowManager.Layou... | java | public static void turnScreenOn(Activity context) {
try {
Window window = context.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
window.addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
window.addFlags(WindowManager.Layou... | [
"public",
"static",
"void",
"turnScreenOn",
"(",
"Activity",
"context",
")",
"{",
"try",
"{",
"Window",
"window",
"=",
"context",
".",
"getWindow",
"(",
")",
";",
"window",
".",
"addFlags",
"(",
"WindowManager",
".",
"LayoutParams",
".",
"FLAG_DISMISS_KEYGUARD... | Force screen to turn on if the phone is asleep.
@param context The current Context or Activity that this method is called from | [
"Force",
"screen",
"to",
"turn",
"on",
"if",
"the",
"phone",
"is",
"asleep",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ActivityUtils.java#L89-L98 |
100,118 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/MiscUtils.java | MiscUtils.isValidEmail | public final static boolean isValidEmail(String email) {
if (email == null) {
return false;
} else {
return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
}
} | java | public final static boolean isValidEmail(String email) {
if (email == null) {
return false;
} else {
return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches();
}
} | [
"public",
"final",
"static",
"boolean",
"isValidEmail",
"(",
"String",
"email",
")",
"{",
"if",
"(",
"email",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return",
"android",
".",
"util",
".",
"Patterns",
".",
"EMAIL_ADDRESS",
".",
... | Uses androids android.util.Patterns.EMAIL_ADDRESS to check if an email address is valid.
@param email Address to check
@return true if the <code>email</code> is a valid email address. | [
"Uses",
"androids",
"android",
".",
"util",
".",
"Patterns",
".",
"EMAIL_ADDRESS",
"to",
"check",
"if",
"an",
"email",
"address",
"is",
"valid",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/MiscUtils.java#L85-L91 |
100,119 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/MiscUtils.java | MiscUtils.isValidURL | public final static boolean isValidURL(String url) {
if (url == null) {
return false;
} else {
return Patterns.WEB_URL.matcher(url).matches();
}
} | java | public final static boolean isValidURL(String url) {
if (url == null) {
return false;
} else {
return Patterns.WEB_URL.matcher(url).matches();
}
} | [
"public",
"final",
"static",
"boolean",
"isValidURL",
"(",
"String",
"url",
")",
"{",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"else",
"{",
"return",
"Patterns",
".",
"WEB_URL",
".",
"matcher",
"(",
"url",
")",
".",
"mat... | Uses androids android.util.Patterns.WEB_URL to check if an url is valid.
@param url Address to check
@return true if the <code>url</code> is a valid web address. | [
"Uses",
"androids",
"android",
".",
"util",
".",
"Patterns",
".",
"WEB_URL",
"to",
"check",
"if",
"an",
"url",
"is",
"valid",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/MiscUtils.java#L113-L119 |
100,120 | percolate/caffeine | caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java | ToastUtils.quickToast | public static Toast quickToast(Context context, String message, boolean longLength) {
final Toast toast;
if (longLength) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
}
... | java | public static Toast quickToast(Context context, String message, boolean longLength) {
final Toast toast;
if (longLength) {
toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
} else {
toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
}
... | [
"public",
"static",
"Toast",
"quickToast",
"(",
"Context",
"context",
",",
"String",
"message",
",",
"boolean",
"longLength",
")",
"{",
"final",
"Toast",
"toast",
";",
"if",
"(",
"longLength",
")",
"{",
"toast",
"=",
"Toast",
".",
"makeText",
"(",
"context... | Display a toast with the given message.
@param context The current Context or Activity that this method is called from
@param message Message to display
@param longLength if true, will use Toast.LENGTH_LONG (approx 3.5 sec) instead of
@return Toast object that is being displayed. Note,show() has already been cal... | [
"Display",
"a",
"toast",
"with",
"the",
"given",
"message",
"."
] | e2265cab474a6397f4d75b1ed928c356a7b9672e | https://github.com/percolate/caffeine/blob/e2265cab474a6397f4d75b1ed928c356a7b9672e/caffeine/src/main/java/com/percolate/caffeine/ToastUtils.java#L33-L42 |
100,121 | cettia/cettia-java-server | server/src/main/java/io/cettia/ClusteredServer.java | ClusteredServer.onpublish | public Server onpublish(Action<Map<String, Object>> action) {
publishActions.add(action);
return this;
} | java | public Server onpublish(Action<Map<String, Object>> action) {
publishActions.add(action);
return this;
} | [
"public",
"Server",
"onpublish",
"(",
"Action",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"action",
")",
"{",
"publishActions",
".",
"add",
"(",
"action",
")",
";",
"return",
"this",
";",
"}"
] | Adds an action to be called with a message to be published to every node in the cluster. | [
"Adds",
"an",
"action",
"to",
"be",
"called",
"with",
"a",
"message",
"to",
"be",
"published",
"to",
"every",
"node",
"in",
"the",
"cluster",
"."
] | 040d29ea4b44c0157fe678b5064b40d0855315fa | https://github.com/cettia/cettia-java-server/blob/040d29ea4b44c0157fe678b5064b40d0855315fa/server/src/main/java/io/cettia/ClusteredServer.java#L55-L58 |
100,122 | cettia/cettia-java-server | server/src/main/java/io/cettia/ServerSocketPredicates.java | ServerSocketPredicates.tag | public static ServerSocketPredicate tag(String... tags) {
return socket -> socket.tags().containsAll(Arrays.asList(tags));
} | java | public static ServerSocketPredicate tag(String... tags) {
return socket -> socket.tags().containsAll(Arrays.asList(tags));
} | [
"public",
"static",
"ServerSocketPredicate",
"tag",
"(",
"String",
"...",
"tags",
")",
"{",
"return",
"socket",
"->",
"socket",
".",
"tags",
"(",
")",
".",
"containsAll",
"(",
"Arrays",
".",
"asList",
"(",
"tags",
")",
")",
";",
"}"
] | Returns a predicate that tests the socket tags against the given tags. | [
"Returns",
"a",
"predicate",
"that",
"tests",
"the",
"socket",
"tags",
"against",
"the",
"given",
"tags",
"."
] | 040d29ea4b44c0157fe678b5064b40d0855315fa | https://github.com/cettia/cettia-java-server/blob/040d29ea4b44c0157fe678b5064b40d0855315fa/server/src/main/java/io/cettia/ServerSocketPredicates.java#L40-L42 |
100,123 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Router.java | Router.addRoute | public static void addRoute(MangooRoute route) {
Objects.requireNonNull(route, Required.ROUTE.toString());
Preconditions.checkArgument(routes.size() <= MAX_ROUTES, "Maximum of " + MAX_ROUTES + " routes reached");
routes.add(route);
if (route instanceof RequestRoute) {
... | java | public static void addRoute(MangooRoute route) {
Objects.requireNonNull(route, Required.ROUTE.toString());
Preconditions.checkArgument(routes.size() <= MAX_ROUTES, "Maximum of " + MAX_ROUTES + " routes reached");
routes.add(route);
if (route instanceof RequestRoute) {
... | [
"public",
"static",
"void",
"addRoute",
"(",
"MangooRoute",
"route",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"route",
",",
"Required",
".",
"ROUTE",
".",
"toString",
"(",
")",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"routes",
".",
"s... | Adds a new route to the router
@param route The route to add | [
"Adds",
"a",
"new",
"route",
"to",
"the",
"router"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Router.java#L41-L53 |
100,124 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Router.java | Router.getReverseRoute | public static RequestRoute getReverseRoute(String key) {
Objects.requireNonNull(key, Required.KEY.toString());
return reverseRoutes.get(key.toLowerCase(Locale.ENGLISH));
} | java | public static RequestRoute getReverseRoute(String key) {
Objects.requireNonNull(key, Required.KEY.toString());
return reverseRoutes.get(key.toLowerCase(Locale.ENGLISH));
} | [
"public",
"static",
"RequestRoute",
"getReverseRoute",
"(",
"String",
"key",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"Required",
".",
"KEY",
".",
"toString",
"(",
")",
")",
";",
"return",
"reverseRoutes",
".",
"get",
"(",
"key",
".",
... | Retrieves a reverse route by its controller class and controller method
@param key The controller class and method in the form ControllerClass:ControllerMethod
@return A route object based on the given controller and method or null if none found | [
"Retrieves",
"a",
"reverse",
"route",
"by",
"its",
"controller",
"class",
"and",
"controller",
"method"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Router.java#L123-L126 |
100,125 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java | WebSocketService.addChannel | public void addChannel(WebSocketChannel channel) {
Objects.requireNonNull(channel, Required.CHANNEL.toString());
final String url = RequestUtils.getWebSocketURL(channel);
Set<WebSocketChannel> channels = getChannels(url);
if (channels == null) {
channels = new HashSet<>();
... | java | public void addChannel(WebSocketChannel channel) {
Objects.requireNonNull(channel, Required.CHANNEL.toString());
final String url = RequestUtils.getWebSocketURL(channel);
Set<WebSocketChannel> channels = getChannels(url);
if (channels == null) {
channels = new HashSet<>();
... | [
"public",
"void",
"addChannel",
"(",
"WebSocketChannel",
"channel",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"channel",
",",
"Required",
".",
"CHANNEL",
".",
"toString",
"(",
")",
")",
";",
"final",
"String",
"url",
"=",
"RequestUtils",
".",
"getWebS... | Adds a new channel to the manager
@param channel channel The channel to put | [
"Adds",
"a",
"new",
"channel",
"to",
"the",
"manager"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java#L40-L52 |
100,126 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java | WebSocketService.getChannels | public Set<WebSocketChannel> getChannels(String uri) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<WebSocketChannel> channels = this.cache.get(Default.WSS_CACHE_PREFIX.toString() + uri);
return (channels == null) ? new HashSet<>() : channels;
} | java | public Set<WebSocketChannel> getChannels(String uri) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<WebSocketChannel> channels = this.cache.get(Default.WSS_CACHE_PREFIX.toString() + uri);
return (channels == null) ? new HashSet<>() : channels;
} | [
"public",
"Set",
"<",
"WebSocketChannel",
">",
"getChannels",
"(",
"String",
"uri",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"uri",
",",
"Required",
".",
"URI",
".",
"toString",
"(",
")",
")",
";",
"final",
"Set",
"<",
"WebSocketChannel",
">",
"c... | Retrieves all channels under a given URL
@param uri The URI resource for the channels
@return A Set of channels for the URI resource | [
"Retrieves",
"all",
"channels",
"under",
"a",
"given",
"URL"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java#L74-L80 |
100,127 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/ConcurrentService.java | ConcurrentService.submit | public <T> Future<T> submit(Runnable runnable, T result) {
return this.executorService.submit(runnable, result);
} | java | public <T> Future<T> submit(Runnable runnable, T result) {
return this.executorService.submit(runnable, result);
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"Runnable",
"runnable",
",",
"T",
"result",
")",
"{",
"return",
"this",
".",
"executorService",
".",
"submit",
"(",
"runnable",
",",
"result",
")",
";",
"}"
] | Submits a Runnable task for execution and returns a Future representing
that task. The Future's get method will return the given result upon
successful completion.
@param <T> JavaDoc requires this (just ignore it)
@param runnable the task to submit
@param result the result to return
@return a Future representing pend... | [
"Submits",
"a",
"Runnable",
"task",
"for",
"execution",
"and",
"returns",
"a",
"Future",
"representing",
"that",
"task",
".",
"The",
"Future",
"s",
"get",
"method",
"will",
"return",
"the",
"given",
"result",
"upon",
"successful",
"completion",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/ConcurrentService.java#L55-L57 |
100,128 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/i18n/Messages.java | Messages.reload | public void reload(Locale locale) {
this.bundle = ResourceBundle.getBundle(Default.BUNDLE_NAME.toString(), locale);
} | java | public void reload(Locale locale) {
this.bundle = ResourceBundle.getBundle(Default.BUNDLE_NAME.toString(), locale);
} | [
"public",
"void",
"reload",
"(",
"Locale",
"locale",
")",
"{",
"this",
".",
"bundle",
"=",
"ResourceBundle",
".",
"getBundle",
"(",
"Default",
".",
"BUNDLE_NAME",
".",
"toString",
"(",
")",
",",
"locale",
")",
";",
"}"
] | Refreshes the resource bundle by reloading the bundle with the default locale
@param locale The locale to use | [
"Refreshes",
"the",
"resource",
"bundle",
"by",
"reloading",
"the",
"bundle",
"with",
"the",
"default",
"locale"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/i18n/Messages.java#L32-L34 |
100,129 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.withRedirect | public static Response withRedirect(String redirectTo) {
Objects.requireNonNull(redirectTo, Required.REDIRECT_TO.toString());
return new Response(redirectTo);
} | java | public static Response withRedirect(String redirectTo) {
Objects.requireNonNull(redirectTo, Required.REDIRECT_TO.toString());
return new Response(redirectTo);
} | [
"public",
"static",
"Response",
"withRedirect",
"(",
"String",
"redirectTo",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"redirectTo",
",",
"Required",
".",
"REDIRECT_TO",
".",
"toString",
"(",
")",
")",
";",
"return",
"new",
"Response",
"(",
"redirectTo"... | Creates a response object with a given url to redirect to
@param redirectTo The URL to redirect to
@return A response object {@link io.mangoo.routing.Response} | [
"Creates",
"a",
"response",
"object",
"with",
"a",
"given",
"url",
"to",
"redirect",
"to"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L217-L221 |
100,130 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andTemplate | public Response andTemplate(String template) {
Objects.requireNonNull(template, Required.TEMPLATE.toString());
this.template = template;
return this;
} | java | public Response andTemplate(String template) {
Objects.requireNonNull(template, Required.TEMPLATE.toString());
this.template = template;
return this;
} | [
"public",
"Response",
"andTemplate",
"(",
"String",
"template",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"template",
",",
"Required",
".",
"TEMPLATE",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"template",
"=",
"template",
";",
"return",
"th... | Sets a specific template to use for the response
@param template The path to the template (e.g. /mytemplate/template.ftl)
@return A response object {@link io.mangoo.routing.Response} | [
"Sets",
"a",
"specific",
"template",
"to",
"use",
"for",
"the",
"response"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L229-L234 |
100,131 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andCharset | public Response andCharset(String charset) {
Objects.requireNonNull(charset, Required.CHARSET.toString());
this.charset = charset;
return this;
} | java | public Response andCharset(String charset) {
Objects.requireNonNull(charset, Required.CHARSET.toString());
this.charset = charset;
return this;
} | [
"public",
"Response",
"andCharset",
"(",
"String",
"charset",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"charset",
",",
"Required",
".",
"CHARSET",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"charset",
"=",
"charset",
";",
"return",
"this",
... | Sets a specific charset to the response
@param charset The charset to use
@return A response object {@link io.mangoo.routing.Response} | [
"Sets",
"a",
"specific",
"charset",
"to",
"the",
"response"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L256-L261 |
100,132 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andCookie | public Response andCookie(Cookie cookie) {
Objects.requireNonNull(cookie, Required.COOKIE.toString());
this.cookies.add(cookie);
return this;
} | java | public Response andCookie(Cookie cookie) {
Objects.requireNonNull(cookie, Required.COOKIE.toString());
this.cookies.add(cookie);
return this;
} | [
"public",
"Response",
"andCookie",
"(",
"Cookie",
"cookie",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"cookie",
",",
"Required",
".",
"COOKIE",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"cookies",
".",
"add",
"(",
"cookie",
")",
";",
"re... | Adds an additional Cookie to the response which is passed to the client
@param cookie The cookie to add
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"an",
"additional",
"Cookie",
"to",
"the",
"response",
"which",
"is",
"passed",
"to",
"the",
"client"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L311-L316 |
100,133 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andBinaryFile | @SuppressFBWarnings(justification = "null check of file on entry point of method", value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public Response andBinaryFile(Path file) {
Objects.requireNonNull(file, Required.FILE.toString());
try (InputStream inputStream = Files.newInputStream(file)) {
... | java | @SuppressFBWarnings(justification = "null check of file on entry point of method", value = "NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public Response andBinaryFile(Path file) {
Objects.requireNonNull(file, Required.FILE.toString());
try (InputStream inputStream = Files.newInputStream(file)) {
... | [
"@",
"SuppressFBWarnings",
"(",
"justification",
"=",
"\"null check of file on entry point of method\"",
",",
"value",
"=",
"\"NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE\"",
")",
"public",
"Response",
"andBinaryFile",
"(",
"Path",
"file",
")",
"{",
"Objects",
".",
"requireNonNu... | Sends a binary file to the client skipping rendering
@param file The file to send
@return A response object {@link io.mangoo.routing.Response} | [
"Sends",
"a",
"binary",
"file",
"to",
"the",
"client",
"skipping",
"rendering"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L342-L356 |
100,134 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andBinaryContent | public Response andBinaryContent(byte [] content) {
Objects.requireNonNull(content, Required.CONTENT.toString());
this.binaryContent = content.clone();
this.binary = true;
this.rendered = false;
return this;
} | java | public Response andBinaryContent(byte [] content) {
Objects.requireNonNull(content, Required.CONTENT.toString());
this.binaryContent = content.clone();
this.binary = true;
this.rendered = false;
return this;
} | [
"public",
"Response",
"andBinaryContent",
"(",
"byte",
"[",
"]",
"content",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"content",
",",
"Required",
".",
"CONTENT",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"binaryContent",
"=",
"content",
".",... | Sends binary content to the client skipping rendering
@param content The content to to send
@return A response object {@link io.mangoo.routing.Response} | [
"Sends",
"binary",
"content",
"to",
"the",
"client",
"skipping",
"rendering"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L364-L372 |
100,135 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andHeader | public Response andHeader(HttpString key, String value) {
Objects.requireNonNull(key, Required.KEY.toString());
this.headers.put(key, value);
return this;
} | java | public Response andHeader(HttpString key, String value) {
Objects.requireNonNull(key, Required.KEY.toString());
this.headers.put(key, value);
return this;
} | [
"public",
"Response",
"andHeader",
"(",
"HttpString",
"key",
",",
"String",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"Required",
".",
"KEY",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"headers",
".",
"put",
"(",
"key... | Adds an additional header to the request response. If an header
key already exists, it will we overwritten with the latest value.
@param key The header constant from Headers class (e.g. Header.CONTENT_TYPE.toString())
@param value The header value
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"an",
"additional",
"header",
"to",
"the",
"request",
"response",
".",
"If",
"an",
"header",
"key",
"already",
"exists",
"it",
"will",
"we",
"overwritten",
"with",
"the",
"latest",
"value",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L411-L416 |
100,136 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andContent | public Response andContent(Map<String, Object> content) {
Objects.requireNonNull(content, Required.CONTENT.toString());
this.content.putAll(content);
return this;
} | java | public Response andContent(Map<String, Object> content) {
Objects.requireNonNull(content, Required.CONTENT.toString());
this.content.putAll(content);
return this;
} | [
"public",
"Response",
"andContent",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"content",
",",
"Required",
".",
"CONTENT",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"content",
".",
... | Adds an additional content map to the content rendered in the template.
Already existing values with the same key are overwritten.
@param content The content map to add
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"an",
"additional",
"content",
"map",
"to",
"the",
"content",
"rendered",
"in",
"the",
"template",
".",
"Already",
"existing",
"values",
"with",
"the",
"same",
"key",
"are",
"overwritten",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L425-L430 |
100,137 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/Response.java | Response.andHeaders | public Response andHeaders(Map<HttpString, String> headers) {
Objects.requireNonNull(headers, Required.HEADERS.toString());
this.headers.putAll(headers);
return this;
} | java | public Response andHeaders(Map<HttpString, String> headers) {
Objects.requireNonNull(headers, Required.HEADERS.toString());
this.headers.putAll(headers);
return this;
} | [
"public",
"Response",
"andHeaders",
"(",
"Map",
"<",
"HttpString",
",",
"String",
">",
"headers",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"headers",
",",
"Required",
".",
"HEADERS",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"headers",
".... | Adds an additional header map to the response.
Already existing values with the same key are overwritten.
@param headers The headers map to add
@return A response object {@link io.mangoo.routing.Response} | [
"Adds",
"an",
"additional",
"header",
"map",
"to",
"the",
"response",
".",
"Already",
"existing",
"values",
"with",
"the",
"same",
"key",
"are",
"overwritten",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/Response.java#L439-L444 |
100,138 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java | RequestRoute.respondeWith | public RequestRoute respondeWith(String method) {
Objects.requireNonNull(method, Required.CONTROLLER_METHOD.toString());
this.controllerMethod = method;
return this;
} | java | public RequestRoute respondeWith(String method) {
Objects.requireNonNull(method, Required.CONTROLLER_METHOD.toString());
this.controllerMethod = method;
return this;
} | [
"public",
"RequestRoute",
"respondeWith",
"(",
"String",
"method",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"method",
",",
"Required",
".",
"CONTROLLER_METHOD",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"controllerMethod",
"=",
"method",
";",
... | Sets the controller method to response on request
@param method The controller method
@return RequestRoute instance | [
"Sets",
"the",
"controller",
"method",
"to",
"response",
"on",
"request"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java#L66-L70 |
100,139 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java | RequestRoute.withControllerClass | public void withControllerClass(Class<?> clazz) {
Objects.requireNonNull(clazz, Required.CONTROLLER_CLASS.toString());
this.controllerClass = clazz;
} | java | public void withControllerClass(Class<?> clazz) {
Objects.requireNonNull(clazz, Required.CONTROLLER_CLASS.toString());
this.controllerClass = clazz;
} | [
"public",
"void",
"withControllerClass",
"(",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"clazz",
",",
"Required",
".",
"CONTROLLER_CLASS",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"controllerClass",
"=",
"cl... | Sets the controller class of this request
@param clazz The controller class | [
"Sets",
"the",
"controller",
"class",
"of",
"this",
"request"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java#L88-L91 |
100,140 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java | RequestRoute.withHttpMethod | public void withHttpMethod(Http method) {
Objects.requireNonNull(method, Required.METHOD.toString());
this.method = method;
} | java | public void withHttpMethod(Http method) {
Objects.requireNonNull(method, Required.METHOD.toString());
this.method = method;
} | [
"public",
"void",
"withHttpMethod",
"(",
"Http",
"method",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"method",
",",
"Required",
".",
"METHOD",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"method",
"=",
"method",
";",
"}"
] | Sets the HTTP method of this request
@param method The controller method | [
"Sets",
"the",
"HTTP",
"method",
"of",
"this",
"request"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/routes/RequestRoute.java#L98-L101 |
100,141 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java | Request.getHeader | public String getHeader(HttpString headerName) {
return (this.httpServerExchange.getRequestHeaders().get(headerName) == null) ? null : this.httpServerExchange.getRequestHeaders().get(headerName).element();
} | java | public String getHeader(HttpString headerName) {
return (this.httpServerExchange.getRequestHeaders().get(headerName) == null) ? null : this.httpServerExchange.getRequestHeaders().get(headerName).element();
} | [
"public",
"String",
"getHeader",
"(",
"HttpString",
"headerName",
")",
"{",
"return",
"(",
"this",
".",
"httpServerExchange",
".",
"getRequestHeaders",
"(",
")",
".",
"get",
"(",
"headerName",
")",
"==",
"null",
")",
"?",
"null",
":",
"this",
".",
"httpSer... | Retrieves a specific header value by its name
@param headerName The name of the header to retrieve
@return The value of the header or null if none found | [
"Retrieves",
"a",
"specific",
"header",
"value",
"by",
"its",
"name"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java#L168-L170 |
100,142 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java | Request.addAttribute | public void addAttribute(String key, Object value) {
Objects.requireNonNull(key, Required.KEY.toString());
this.attributes.put(key, value);
} | java | public void addAttribute(String key, Object value) {
Objects.requireNonNull(key, Required.KEY.toString());
this.attributes.put(key, value);
} | [
"public",
"void",
"addAttribute",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"Required",
".",
"KEY",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"attributes",
".",
"put",
"(",
"key",... | Adds an attribute to the internal attributes map
@param key The key to store the attribute
@param value The value to store | [
"Adds",
"an",
"attribute",
"to",
"the",
"internal",
"attributes",
"map"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java#L242-L245 |
100,143 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java | Request.getAttribute | public Object getAttribute(String key) {
Objects.requireNonNull(key, Required.KEY.toString());
return this.attributes.get(key);
} | java | public Object getAttribute(String key) {
Objects.requireNonNull(key, Required.KEY.toString());
return this.attributes.get(key);
} | [
"public",
"Object",
"getAttribute",
"(",
"String",
"key",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"key",
",",
"Required",
".",
"KEY",
".",
"toString",
"(",
")",
")",
";",
"return",
"this",
".",
"attributes",
".",
"get",
"(",
"key",
")",
";",
... | Returns an object attribute from a given key
@param key The key the attribute is stored
@return Object the value from the attribues map | [
"Returns",
"an",
"object",
"attribute",
"from",
"a",
"given",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Request.java#L284-L287 |
100,144 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java | ServerSentEventService.addConnection | public void addConnection(ServerSentEventConnection connection) {
Objects.requireNonNull(connection, Required.CONNECTION.toString());
final String url = RequestUtils.getServerSentEventURL(connection);
Set<ServerSentEventConnection> uriConnections = getConnections(url);
if (uriConnection... | java | public void addConnection(ServerSentEventConnection connection) {
Objects.requireNonNull(connection, Required.CONNECTION.toString());
final String url = RequestUtils.getServerSentEventURL(connection);
Set<ServerSentEventConnection> uriConnections = getConnections(url);
if (uriConnection... | [
"public",
"void",
"addConnection",
"(",
"ServerSentEventConnection",
"connection",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"connection",
",",
"Required",
".",
"CONNECTION",
".",
"toString",
"(",
")",
")",
";",
"final",
"String",
"url",
"=",
"RequestUtil... | Adds a new connection to the manager
@param connection The connection to put | [
"Adds",
"a",
"new",
"connection",
"to",
"the",
"manager"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java#L41-L53 |
100,145 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java | ServerSentEventService.send | public void send(String uri, String data) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<ServerSentEventConnection> uriConnections = getConnections(uri);
if (uriConnections != null) {
uriConnections.stream()
.filter(ServerSentEventConnection::isOpe... | java | public void send(String uri, String data) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<ServerSentEventConnection> uriConnections = getConnections(uri);
if (uriConnections != null) {
uriConnections.stream()
.filter(ServerSentEventConnection::isOpe... | [
"public",
"void",
"send",
"(",
"String",
"uri",
",",
"String",
"data",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"uri",
",",
"Required",
".",
"URI",
".",
"toString",
"(",
")",
")",
";",
"final",
"Set",
"<",
"ServerSentEventConnection",
">",
"uriCo... | Sends data to all connections for a given URI resource
@param uri The URI resource for the connection
@param data The event data | [
"Sends",
"data",
"to",
"all",
"connections",
"for",
"a",
"given",
"URI",
"resource"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java#L61-L71 |
100,146 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java | ServerSentEventService.getConnections | public Set<ServerSentEventConnection> getConnections(String uri) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<ServerSentEventConnection> uriConnections = this.cache.get(Default.SSE_CACHE_PREFIX.toString() + uri);
return (uriConnections == null) ? new HashSet<>() : uriConne... | java | public Set<ServerSentEventConnection> getConnections(String uri) {
Objects.requireNonNull(uri, Required.URI.toString());
final Set<ServerSentEventConnection> uriConnections = this.cache.get(Default.SSE_CACHE_PREFIX.toString() + uri);
return (uriConnections == null) ? new HashSet<>() : uriConne... | [
"public",
"Set",
"<",
"ServerSentEventConnection",
">",
"getConnections",
"(",
"String",
"uri",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"uri",
",",
"Required",
".",
"URI",
".",
"toString",
"(",
")",
")",
";",
"final",
"Set",
"<",
"ServerSentEventCon... | Retrieves all connection resources under a given URL
@param uri The URI resource for the connections
@return A Set of connections for the URI resource | [
"Retrieves",
"all",
"connection",
"resources",
"under",
"a",
"given",
"URL"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/ServerSentEventService.java#L119-L125 |
100,147 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Flash.java | Flash.put | public void put(String key, String value) {
if (validCharacters(key) && validCharacters(value)) {
this.values.put(key, value);
}
} | java | public void put(String key, String value) {
if (validCharacters(key) && validCharacters(value)) {
this.values.put(key, value);
}
} | [
"public",
"void",
"put",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"validCharacters",
"(",
"key",
")",
"&&",
"validCharacters",
"(",
"value",
")",
")",
"{",
"this",
".",
"values",
".",
"put",
"(",
"key",
",",
"value",
")",
... | Adds a value with a specific key to the flash overwriting an
existing value
@param key The key
@param value The value | [
"Adds",
"a",
"value",
"with",
"a",
"specific",
"key",
"to",
"the",
"flash",
"overwriting",
"an",
"existing",
"value"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Flash.java#L86-L90 |
100,148 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Flash.java | Flash.validCharacters | private boolean validCharacters(String value) {
if (INVALID_CHARACTERS.contains(value)) {
LOG.error("Flash key or value can not contain the following characters: spaces, |, & or :");
return false;
}
return true;
} | java | private boolean validCharacters(String value) {
if (INVALID_CHARACTERS.contains(value)) {
LOG.error("Flash key or value can not contain the following characters: spaces, |, & or :");
return false;
}
return true;
} | [
"private",
"boolean",
"validCharacters",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"INVALID_CHARACTERS",
".",
"contains",
"(",
"value",
")",
")",
"{",
"LOG",
".",
"error",
"(",
"\"Flash key or value can not contain the following characters: spaces, |, & or :\"",
")",... | Checks if the given value contains characters that are not allowed
in the key or value of a flash cookie
@param value The value to check
@return True if the given string is valid, false otherwise | [
"Checks",
"if",
"the",
"given",
"value",
"contains",
"characters",
"that",
"are",
"not",
"allowed",
"in",
"the",
"key",
"or",
"value",
"of",
"a",
"flash",
"cookie"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Flash.java#L138-L145 |
100,149 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java | MangooUtils.getVersion | public static String getVersion() {
String version = Default.VERSION_UNKNOW.toString();
try (InputStream inputStream = Resources.getResource(Default.VERSION_PROPERTIES.toString()).openStream()) {
final Properties properties = new Properties();
properties.load(inputStream);
... | java | public static String getVersion() {
String version = Default.VERSION_UNKNOW.toString();
try (InputStream inputStream = Resources.getResource(Default.VERSION_PROPERTIES.toString()).openStream()) {
final Properties properties = new Properties();
properties.load(inputStream);
... | [
"public",
"static",
"String",
"getVersion",
"(",
")",
"{",
"String",
"version",
"=",
"Default",
".",
"VERSION_UNKNOW",
".",
"toString",
"(",
")",
";",
"try",
"(",
"InputStream",
"inputStream",
"=",
"Resources",
".",
"getResource",
"(",
"Default",
".",
"VERSI... | Retrieves the current version of the framework from the version.properties file
@return Current mangoo I/O version | [
"Retrieves",
"the",
"current",
"version",
"of",
"the",
"framework",
"from",
"the",
"version",
".",
"properties",
"file"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java#L45-L56 |
100,150 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java | MangooUtils.copyMap | public static Map<String, String> copyMap(Map<String, String> originalMap) {
Objects.requireNonNull(originalMap, Required.MAP.toString());
return new HashMap<>(originalMap);
} | java | public static Map<String, String> copyMap(Map<String, String> originalMap) {
Objects.requireNonNull(originalMap, Required.MAP.toString());
return new HashMap<>(originalMap);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"copyMap",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"originalMap",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"originalMap",
",",
"Required",
".",
"MAP",
".",
"toString",
"(",
")",... | Copies a given map to a new map instance
@param originalMap The map to copy
@return A new Map instance with value from originalMap | [
"Copies",
"a",
"given",
"map",
"to",
"a",
"new",
"map",
"instance"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java#L64-L68 |
100,151 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java | MangooUtils.randomString | public static String randomString(int length) {
Preconditions.checkArgument(length > MIN_PASSWORD_LENGTH, "random string length must be at least 1 character");
Preconditions.checkArgument(length <= MAX_PASSWORD_LENGTH, "random string length must be at most 256 character");
return Random... | java | public static String randomString(int length) {
Preconditions.checkArgument(length > MIN_PASSWORD_LENGTH, "random string length must be at least 1 character");
Preconditions.checkArgument(length <= MAX_PASSWORD_LENGTH, "random string length must be at most 256 character");
return Random... | [
"public",
"static",
"String",
"randomString",
"(",
"int",
"length",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"length",
">",
"MIN_PASSWORD_LENGTH",
",",
"\"random string length must be at least 1 character\"",
")",
";",
"Preconditions",
".",
"checkArgument",
... | Generates a random string with the given length.
Based on commons-lang3 RandomStringUtils using SecureRandom
Uses: uppercase letters, lowercase letters and numbers
@param length The length of the random string
@return A random String | [
"Generates",
"a",
"random",
"string",
"with",
"the",
"given",
"length",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java#L80-L85 |
100,152 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java | MangooUtils.readableFileSize | public static String readableFileSize(long size) {
if (size <= 0) {
return "0";
}
int index = (int) (Math.log10(size) / Math.log10(CONVERTION));
return new DecimalFormat("#,##0.#").format(size / Math.pow(CONVERTION, index)) + " " + UNITS[index];
} | java | public static String readableFileSize(long size) {
if (size <= 0) {
return "0";
}
int index = (int) (Math.log10(size) / Math.log10(CONVERTION));
return new DecimalFormat("#,##0.#").format(size / Math.pow(CONVERTION, index)) + " " + UNITS[index];
} | [
"public",
"static",
"String",
"readableFileSize",
"(",
"long",
"size",
")",
"{",
"if",
"(",
"size",
"<=",
"0",
")",
"{",
"return",
"\"0\"",
";",
"}",
"int",
"index",
"=",
"(",
"int",
")",
"(",
"Math",
".",
"log10",
"(",
"size",
")",
"/",
"Math",
... | Converts a given file size into a readable file size including unit
@param size The size in bytes to convert
@return Readable files size, e.g. 24 MB | [
"Converts",
"a",
"given",
"file",
"size",
"into",
"a",
"readable",
"file",
"size",
"including",
"unit"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java#L103-L110 |
100,153 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java | MangooUtils.resourceExists | public static boolean resourceExists(String name) {
Objects.requireNonNull(name, Required.NAME.toString());
URL resource = null;
try {
resource = Resources.getResource(name);
} catch (IllegalArgumentException e) { // NOSONAR Intentionally not logging or t... | java | public static boolean resourceExists(String name) {
Objects.requireNonNull(name, Required.NAME.toString());
URL resource = null;
try {
resource = Resources.getResource(name);
} catch (IllegalArgumentException e) { // NOSONAR Intentionally not logging or t... | [
"public",
"static",
"boolean",
"resourceExists",
"(",
"String",
"name",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"name",
",",
"Required",
".",
"NAME",
".",
"toString",
"(",
")",
")",
";",
"URL",
"resource",
"=",
"null",
";",
"try",
"{",
"resource... | Checks if a resource exists in the classpath
@param name The name of the resource
@return True if the resources exists, false otherwise | [
"Checks",
"if",
"a",
"resource",
"exists",
"in",
"the",
"classpath"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/MangooUtils.java#L118-L129 |
100,154 | svenkubiak/mangooio | mangooio-maven-plugin/src/main/java/io/mangoo/build/Minification.java | Minification.minify | public static void minify(String absolutePath) {
if (absolutePath == null || absolutePath.contains(MIN)) {
return;
}
if (config == null) {
System.setProperty(Key.APPLICATION_CONFIG.toString(), basePath + Default.CONFIG_PATH.toString());
config = new Config(Mo... | java | public static void minify(String absolutePath) {
if (absolutePath == null || absolutePath.contains(MIN)) {
return;
}
if (config == null) {
System.setProperty(Key.APPLICATION_CONFIG.toString(), basePath + Default.CONFIG_PATH.toString());
config = new Config(Mo... | [
"public",
"static",
"void",
"minify",
"(",
"String",
"absolutePath",
")",
"{",
"if",
"(",
"absolutePath",
"==",
"null",
"||",
"absolutePath",
".",
"contains",
"(",
"MIN",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"config",
"==",
"null",
")",
"{",
... | Minifies a JS or CSS file to a corresponding JS or CSS file
@param absolutePath The absolute path to the file | [
"Minifies",
"a",
"JS",
"or",
"CSS",
"file",
"to",
"a",
"corresponding",
"JS",
"or",
"CSS",
"file"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-maven-plugin/src/main/java/io/mangoo/build/Minification.java#L76-L91 |
100,155 | svenkubiak/mangooio | mangooio-maven-plugin/src/main/java/io/mangoo/build/Minification.java | Minification.preprocess | public static void preprocess(String absolutePath) {
if (absolutePath == null) {
return;
}
if (config == null) {
System.setProperty(Key.APPLICATION_CONFIG.toString(), basePath + Default.CONFIG_PATH.toString());
config = new Config();
}
if (co... | java | public static void preprocess(String absolutePath) {
if (absolutePath == null) {
return;
}
if (config == null) {
System.setProperty(Key.APPLICATION_CONFIG.toString(), basePath + Default.CONFIG_PATH.toString());
config = new Config();
}
if (co... | [
"public",
"static",
"void",
"preprocess",
"(",
"String",
"absolutePath",
")",
"{",
"if",
"(",
"absolutePath",
"==",
"null",
")",
"{",
"return",
";",
"}",
"if",
"(",
"config",
"==",
"null",
")",
"{",
"System",
".",
"setProperty",
"(",
"Key",
".",
"APPLI... | Compiles a LESS or SASS file to a corresponding CSS file
@param absolutePath The absolute path to the file | [
"Compiles",
"a",
"LESS",
"or",
"SASS",
"file",
"to",
"a",
"corresponding",
"CSS",
"file"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-maven-plugin/src/main/java/io/mangoo/build/Minification.java#L98-L113 |
100,156 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/templating/TemplateEngine.java | TemplateEngine.getSources | @SuppressFBWarnings(justification = "SourcePath should intentionally come from user file path", value = "PATH_TRAVERSAL_IN")
private List<Source> getSources(int errorLine, String sourcePath) throws IOException {
Objects.requireNonNull(sourcePath, Required.SOURCE_PATH.toString());
StringBuilder buff... | java | @SuppressFBWarnings(justification = "SourcePath should intentionally come from user file path", value = "PATH_TRAVERSAL_IN")
private List<Source> getSources(int errorLine, String sourcePath) throws IOException {
Objects.requireNonNull(sourcePath, Required.SOURCE_PATH.toString());
StringBuilder buff... | [
"@",
"SuppressFBWarnings",
"(",
"justification",
"=",
"\"SourcePath should intentionally come from user file path\"",
",",
"value",
"=",
"\"PATH_TRAVERSAL_IN\"",
")",
"private",
"List",
"<",
"Source",
">",
"getSources",
"(",
"int",
"errorLine",
",",
"String",
"sourcePath"... | Retrieves the lines of code where an exception occurred
@param errorLine The line number of the exception
@param sourcePath The path to the source code file
@return A list of source code with the exception and surrounding lines
@throws IOException If an IO exception occurs | [
"Retrieves",
"the",
"lines",
"of",
"code",
"where",
"an",
"exception",
"occurred"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/templating/TemplateEngine.java#L145-L173 |
100,157 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/templating/TemplateEngine.java | TemplateEngine.getSourceCodePath | private String getSourceCodePath(StackTraceElement stackTraceElement) {
Objects.requireNonNull(stackTraceElement, Required.STACK_TRACE_ELEMENT.toString());
String packageName = stackTraceElement.getClassName();
int position = packageName.lastIndexOf('.');
if (position > 0) {
... | java | private String getSourceCodePath(StackTraceElement stackTraceElement) {
Objects.requireNonNull(stackTraceElement, Required.STACK_TRACE_ELEMENT.toString());
String packageName = stackTraceElement.getClassName();
int position = packageName.lastIndexOf('.');
if (position > 0) {
... | [
"private",
"String",
"getSourceCodePath",
"(",
"StackTraceElement",
"stackTraceElement",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"stackTraceElement",
",",
"Required",
".",
"STACK_TRACE_ELEMENT",
".",
"toString",
"(",
")",
")",
";",
"String",
"packageName",
... | Retrieves the source code file name from an StrackTraceElement
@param stackTraceElement The StrackTraceElement to check
@return Source code filename | [
"Retrieves",
"the",
"source",
"code",
"file",
"name",
"from",
"an",
"StrackTraceElement"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/templating/TemplateEngine.java#L197-L208 |
100,158 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/LimitHandler.java | LimitHandler.getCacheKey | private String getCacheKey(HttpServerExchange exchange) {
String host = null;
HeaderMap headerMap = exchange.getRequestHeaders();
if (headerMap != null) {
HeaderValues headerValues = headerMap.get(Header.X_FORWARDED_FOR.toHttpString());
if (headerValues != null) {
... | java | private String getCacheKey(HttpServerExchange exchange) {
String host = null;
HeaderMap headerMap = exchange.getRequestHeaders();
if (headerMap != null) {
HeaderValues headerValues = headerMap.get(Header.X_FORWARDED_FOR.toHttpString());
if (headerValues != null) {
... | [
"private",
"String",
"getCacheKey",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"String",
"host",
"=",
"null",
";",
"HeaderMap",
"headerMap",
"=",
"exchange",
".",
"getRequestHeaders",
"(",
")",
";",
"if",
"(",
"headerMap",
"!=",
"null",
")",
"{",
"Head... | Creates a key for used for limit an request containing the
requested url and the source host
@param exchange The HttpServerExchange
@return The key url + host | [
"Creates",
"a",
"key",
"for",
"used",
"for",
"limit",
"an",
"request",
"containing",
"the",
"requested",
"url",
"and",
"the",
"source",
"host"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/LimitHandler.java#L70-L98 |
100,159 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/LimitHandler.java | LimitHandler.nextHandler | protected void nextHandler(HttpServerExchange exchange) throws Exception {
if (this.attachment.hasBasicAuthentication()) {
HttpHandler httpHandler = RequestUtils.wrapBasicAuthentication(
Application.getInstance(LocaleHandler.class),
this.attachment.getUsername... | java | protected void nextHandler(HttpServerExchange exchange) throws Exception {
if (this.attachment.hasBasicAuthentication()) {
HttpHandler httpHandler = RequestUtils.wrapBasicAuthentication(
Application.getInstance(LocaleHandler.class),
this.attachment.getUsername... | [
"protected",
"void",
"nextHandler",
"(",
"HttpServerExchange",
"exchange",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"attachment",
".",
"hasBasicAuthentication",
"(",
")",
")",
"{",
"HttpHandler",
"httpHandler",
"=",
"RequestUtils",
".",
"wrapBasicA... | Handles the next request in the handler chain
@param exchange The HttpServerExchange
@throws Exception Thrown when an exception occurs | [
"Handles",
"the",
"next",
"request",
"in",
"the",
"handler",
"chain"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/LimitHandler.java#L115-L126 |
100,160 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/TotpUtils.java | TotpUtils.getQRCode | public static String getQRCode(String name, String issuer, String secret, HmacShaAlgorithm algorithm, String digits, String period) {
Objects.requireNonNull(name, Required.ACCOUNT_NAME.toString());
Objects.requireNonNull(secret, Required.SECRET.toString());
Objects.requireNonNull(issuer, Require... | java | public static String getQRCode(String name, String issuer, String secret, HmacShaAlgorithm algorithm, String digits, String period) {
Objects.requireNonNull(name, Required.ACCOUNT_NAME.toString());
Objects.requireNonNull(secret, Required.SECRET.toString());
Objects.requireNonNull(issuer, Require... | [
"public",
"static",
"String",
"getQRCode",
"(",
"String",
"name",
",",
"String",
"issuer",
",",
"String",
"secret",
",",
"HmacShaAlgorithm",
"algorithm",
",",
"String",
"digits",
",",
"String",
"period",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"name",... | Generates a QR code to share a secret with a user
@param name The name of the account
@param issuer The name of the issuer
@param secret The secret to use
@param algorithm The algorithm to use
@param digits The number of digits to use
@param period The period to use
@return An URL to Google charts API with the QR cod... | [
"Generates",
"a",
"QR",
"code",
"to",
"share",
"a",
"secret",
"with",
"a",
"user"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/TotpUtils.java#L156-L169 |
100,161 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/TotpUtils.java | TotpUtils.getOtpauthURL | public static String getOtpauthURL(String name, String issuer, String secret, HmacShaAlgorithm algorithm, String digits, String period) {
Objects.requireNonNull(name, Required.ACCOUNT_NAME.toString());
Objects.requireNonNull(secret, Required.SECRET.toString());
Objects.requireNonNull(issuer, Req... | java | public static String getOtpauthURL(String name, String issuer, String secret, HmacShaAlgorithm algorithm, String digits, String period) {
Objects.requireNonNull(name, Required.ACCOUNT_NAME.toString());
Objects.requireNonNull(secret, Required.SECRET.toString());
Objects.requireNonNull(issuer, Req... | [
"public",
"static",
"String",
"getOtpauthURL",
"(",
"String",
"name",
",",
"String",
"issuer",
",",
"String",
"secret",
",",
"HmacShaAlgorithm",
"algorithm",
",",
"String",
"digits",
",",
"String",
"period",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"na... | Generates a otpauth code to share a secret with a user
@param name The name of the account
@param issuer The name of the issuer
@param secret The secret to use
@param algorithm The algorithm to use
@param digits The number of digits to use
@param period The period to use
@return An otpauth url | [
"Generates",
"a",
"otpauth",
"code",
"to",
"share",
"a",
"secret",
"with",
"a",
"user"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/TotpUtils.java#L183-L213 |
100,162 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getSessionCookie | @SuppressWarnings("unchecked")
protected Session getSessionCookie(HttpServerExchange exchange) {
Session session = Session.create()
.withContent(new HashMap<>())
.withAuthenticity(MangooUtils.randomString(STRING_LENGTH));
if (this.config.getSessionCookieExpires() > 0) {
... | java | @SuppressWarnings("unchecked")
protected Session getSessionCookie(HttpServerExchange exchange) {
Session session = Session.create()
.withContent(new HashMap<>())
.withAuthenticity(MangooUtils.randomString(STRING_LENGTH));
if (this.config.getSessionCookieExpires() > 0) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Session",
"getSessionCookie",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Session",
"session",
"=",
"Session",
".",
"create",
"(",
")",
".",
"withContent",
"(",
"new",
"HashMap",
"<>",
"(",
... | Retrieves the current session from the HttpServerExchange
@param exchange The Undertow HttpServerExchange | [
"Retrieves",
"the",
"current",
"session",
"from",
"the",
"HttpServerExchange"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L75-L116 |
100,163 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getAuthenticationCookie | protected Authentication getAuthenticationCookie(HttpServerExchange exchange) {
Authentication authentication = Authentication.create().withSubject(null);
String cookieValue = getCookieValue(exchange, this.config.getAuthenticationCookieName());
if (StringUtils.isNotBlank(cookieValue)) {... | java | protected Authentication getAuthenticationCookie(HttpServerExchange exchange) {
Authentication authentication = Authentication.create().withSubject(null);
String cookieValue = getCookieValue(exchange, this.config.getAuthenticationCookieName());
if (StringUtils.isNotBlank(cookieValue)) {... | [
"protected",
"Authentication",
"getAuthenticationCookie",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Authentication",
"authentication",
"=",
"Authentication",
".",
"create",
"(",
")",
".",
"withSubject",
"(",
"null",
")",
";",
"String",
"cookieValue",
"=",
"g... | Retrieves the current authentication from the HttpServerExchange
@param exchange The Undertow HttpServerExchange | [
"Retrieves",
"the",
"current",
"authentication",
"from",
"the",
"HttpServerExchange"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L123-L159 |
100,164 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getFlashCookie | @SuppressWarnings("unchecked")
protected Flash getFlashCookie(HttpServerExchange exchange) {
Flash flash = Flash.create();
final String cookieValue = getCookieValue(exchange, this.config.getFlashCookieName());
if (StringUtils.isNotBlank(cookieValue)) {
try {
... | java | @SuppressWarnings("unchecked")
protected Flash getFlashCookie(HttpServerExchange exchange) {
Flash flash = Flash.create();
final String cookieValue = getCookieValue(exchange, this.config.getFlashCookieName());
if (StringUtils.isNotBlank(cookieValue)) {
try {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"Flash",
"getFlashCookie",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Flash",
"flash",
"=",
"Flash",
".",
"create",
"(",
")",
";",
"final",
"String",
"cookieValue",
"=",
"getCookieValue",
"(... | Retrieves the flash cookie from the current
@param exchange The Undertow HttpServerExchange | [
"Retrieves",
"the",
"flash",
"cookie",
"from",
"the",
"current"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L166-L197 |
100,165 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java | InboundCookiesHandler.getCookieValue | private String getCookieValue(HttpServerExchange exchange, String cookieName) {
String value = null;
Map<String, Cookie> requestCookies = exchange.getRequestCookies();
if (requestCookies != null) {
Cookie cookie = exchange.getRequestCookies().get(cookieName);
if (cookie !... | java | private String getCookieValue(HttpServerExchange exchange, String cookieName) {
String value = null;
Map<String, Cookie> requestCookies = exchange.getRequestCookies();
if (requestCookies != null) {
Cookie cookie = exchange.getRequestCookies().get(cookieName);
if (cookie !... | [
"private",
"String",
"getCookieValue",
"(",
"HttpServerExchange",
"exchange",
",",
"String",
"cookieName",
")",
"{",
"String",
"value",
"=",
"null",
";",
"Map",
"<",
"String",
",",
"Cookie",
">",
"requestCookies",
"=",
"exchange",
".",
"getRequestCookies",
"(",
... | Retrieves the value of a cookie with a given name from a HttpServerExchange
@param exchange The exchange containing the cookie
@param cookieName The name of the cookie
@return The value of the cookie or null if none found | [
"Retrieves",
"the",
"value",
"of",
"a",
"cookie",
"with",
"a",
"given",
"name",
"from",
"a",
"HttpServerExchange"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/InboundCookiesHandler.java#L207-L218 |
100,166 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Config.java | Config.parse | private void parse(String propKey, String propValue) {
if (ARG_TAG.equals(propValue)) {
String value = System.getProperty(propKey);
if (StringUtils.isNotBlank(value) && value.startsWith(CRYPTEX_TAG)) {
value = decrypt(value);
}
if (StringUtils.is... | java | private void parse(String propKey, String propValue) {
if (ARG_TAG.equals(propValue)) {
String value = System.getProperty(propKey);
if (StringUtils.isNotBlank(value) && value.startsWith(CRYPTEX_TAG)) {
value = decrypt(value);
}
if (StringUtils.is... | [
"private",
"void",
"parse",
"(",
"String",
"propKey",
",",
"String",
"propValue",
")",
"{",
"if",
"(",
"ARG_TAG",
".",
"equals",
"(",
"propValue",
")",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"propKey",
")",
";",
"if",
"(",... | Parses a given property key and value and checks if the value comes from
a system property and maybe decrypts the value
@param propKey The property key
@param propValue The property value | [
"Parses",
"a",
"given",
"property",
"key",
"and",
"value",
"and",
"checks",
"if",
"the",
"value",
"comes",
"from",
"a",
"system",
"property",
"and",
"maybe",
"decrypts",
"the",
"value"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Config.java#L86-L102 |
100,167 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Config.java | Config.decrypt | private String decrypt(String value) {
Crypto crypto = new Crypto(this);
String keyFile = System.getProperty(Key.APPLICATION_PRIVATEKEY.toString());
if (StringUtils.isNotBlank(keyFile)) {
try (Stream<String> lines = Files.lines(Paths.get(keyFile))) { //NOSONAR KeyFile can in... | java | private String decrypt(String value) {
Crypto crypto = new Crypto(this);
String keyFile = System.getProperty(Key.APPLICATION_PRIVATEKEY.toString());
if (StringUtils.isNotBlank(keyFile)) {
try (Stream<String> lines = Files.lines(Paths.get(keyFile))) { //NOSONAR KeyFile can in... | [
"private",
"String",
"decrypt",
"(",
"String",
"value",
")",
"{",
"Crypto",
"crypto",
"=",
"new",
"Crypto",
"(",
"this",
")",
";",
"String",
"keyFile",
"=",
"System",
".",
"getProperty",
"(",
"Key",
".",
"APPLICATION_PRIVATEKEY",
".",
"toString",
"(",
")",... | Decrypts a given property key and rewrites it to props
@param propKey The property key
@param propValue The property value | [
"Decrypts",
"a",
"given",
"property",
"key",
"and",
"rewrites",
"it",
"to",
"props"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Config.java#L110-L138 |
100,168 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/core/Server.java | Server.header | public static void header(Header header, String value) {
Objects.requireNonNull(header, Required.HEADER.toString());
Map<Header, String> newHeaders = new EnumMap<>(headers);
newHeaders.put(header, value);
headers = newHeaders;
} | java | public static void header(Header header, String value) {
Objects.requireNonNull(header, Required.HEADER.toString());
Map<Header, String> newHeaders = new EnumMap<>(headers);
newHeaders.put(header, value);
headers = newHeaders;
} | [
"public",
"static",
"void",
"header",
"(",
"Header",
"header",
",",
"String",
"value",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"header",
",",
"Required",
".",
"HEADER",
".",
"toString",
"(",
")",
")",
";",
"Map",
"<",
"Header",
",",
"String",
... | Sets a custom header that is used globally on server responses
@param header The name of the header
@param value The value of the header | [
"Sets",
"a",
"custom",
"header",
"that",
"is",
"used",
"globally",
"on",
"server",
"responses"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/core/Server.java#L40-L46 |
100,169 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/email/Mail.java | Mail.withBuilder | public Mail withBuilder(Email email) {
Objects.requireNonNull(email, Required.EMAIL.toString());
this.email = email;
return this;
} | java | public Mail withBuilder(Email email) {
Objects.requireNonNull(email, Required.EMAIL.toString());
this.email = email;
return this;
} | [
"public",
"Mail",
"withBuilder",
"(",
"Email",
"email",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"email",
",",
"Required",
".",
"EMAIL",
".",
"toString",
"(",
")",
")",
";",
"this",
".",
"email",
"=",
"email",
";",
"return",
"this",
";",
"}"
] | Sets the org.Jodd.Email instance that the email is based on
@param email The Email instance
@return A mail object instance | [
"Sets",
"the",
"org",
".",
"Jodd",
".",
"Email",
"instance",
"that",
"the",
"email",
"is",
"based",
"on"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/email/Mail.java#L38-L43 |
100,170 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/email/Mail.java | Mail.templateMessage | public Mail templateMessage(String template, Map<String, Object> content) throws MangooTemplateEngineException {
Objects.requireNonNull(template, Required.TEMPLATE.toString());
Objects.requireNonNull(content, Required.CONTENT.toString());
if (template.charAt(0) == '/' || template.startsWith("\\... | java | public Mail templateMessage(String template, Map<String, Object> content) throws MangooTemplateEngineException {
Objects.requireNonNull(template, Required.TEMPLATE.toString());
Objects.requireNonNull(content, Required.CONTENT.toString());
if (template.charAt(0) == '/' || template.startsWith("\\... | [
"public",
"Mail",
"templateMessage",
"(",
"String",
"template",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"content",
")",
"throws",
"MangooTemplateEngineException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"template",
",",
"Required",
".",
"TEMPLATE",
".... | Sets a template to be rendered for the email. Using a template
will make it a HTML Email by default.
@param template The template to use
@param content The content for the template
@return A mail object instance
@throws MangooTemplateEngineException if rendering of template fails | [
"Sets",
"a",
"template",
"to",
"be",
"rendered",
"for",
"the",
"email",
".",
"Using",
"a",
"template",
"will",
"make",
"it",
"a",
"HTML",
"Email",
"by",
"default",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/email/Mail.java#L54-L67 |
100,171 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/DateUtils.java | DateUtils.localDateTimeToDate | public static Date localDateTimeToDate(LocalDateTime localDateTime) {
Objects.requireNonNull(localDateTime, Required.LOCAL_DATE_TIME.toString());
Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
} | java | public static Date localDateTimeToDate(LocalDateTime localDateTime) {
Objects.requireNonNull(localDateTime, Required.LOCAL_DATE_TIME.toString());
Instant instant = localDateTime.atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
} | [
"public",
"static",
"Date",
"localDateTimeToDate",
"(",
"LocalDateTime",
"localDateTime",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"localDateTime",
",",
"Required",
".",
"LOCAL_DATE_TIME",
".",
"toString",
"(",
")",
")",
";",
"Instant",
"instant",
"=",
"... | Converts a LocalDateTime to Date
@param localDateTime The LocalDateTime to convert
@return The converted Date | [
"Converts",
"a",
"LocalDateTime",
"to",
"Date"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/DateUtils.java#L31-L36 |
100,172 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/DateUtils.java | DateUtils.localDateToDate | public static Date localDateToDate(LocalDate localDate) {
Objects.requireNonNull(localDate, Required.LOCAL_DATE.toString());
Instant instant = localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
} | java | public static Date localDateToDate(LocalDate localDate) {
Objects.requireNonNull(localDate, Required.LOCAL_DATE.toString());
Instant instant = localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant();
return Date.from(instant);
} | [
"public",
"static",
"Date",
"localDateToDate",
"(",
"LocalDate",
"localDate",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"localDate",
",",
"Required",
".",
"LOCAL_DATE",
".",
"toString",
"(",
")",
")",
";",
"Instant",
"instant",
"=",
"localDate",
".",
... | Converts a localDate to Date
@param localDate The LocalDate to convert
@return The converted Date | [
"Converts",
"a",
"localDate",
"to",
"Date"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/DateUtils.java#L44-L49 |
100,173 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java | RequestHandler.getRequest | protected Request getRequest(HttpServerExchange exchange) {
final String authenticity = Optional.ofNullable(this.attachment.getRequestParameter()
.get(Default.AUTHENTICITY.toString()))
.orElse(this.attachment.getForm().get(Default.AUTHENTICITY.toString()));
retur... | java | protected Request getRequest(HttpServerExchange exchange) {
final String authenticity = Optional.ofNullable(this.attachment.getRequestParameter()
.get(Default.AUTHENTICITY.toString()))
.orElse(this.attachment.getForm().get(Default.AUTHENTICITY.toString()));
retur... | [
"protected",
"Request",
"getRequest",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"final",
"String",
"authenticity",
"=",
"Optional",
".",
"ofNullable",
"(",
"this",
".",
"attachment",
".",
"getRequestParameter",
"(",
")",
".",
"get",
"(",
"Default",
".",
... | Creates a new request object containing the current request data
@param exchange The Undertow HttpServerExchange | [
"Creates",
"a",
"new",
"request",
"object",
"containing",
"the",
"current",
"request",
"data"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java#L68-L79 |
100,174 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java | RequestHandler.invokeController | protected Response invokeController(HttpServerExchange exchange, Response response) throws IllegalAccessException, InvocationTargetException, MangooTemplateEngineException, IOException {
Response invokedResponse;
if (this.attachment.getMethodParameters().isEmpty()) {
invokedResponse = (Resp... | java | protected Response invokeController(HttpServerExchange exchange, Response response) throws IllegalAccessException, InvocationTargetException, MangooTemplateEngineException, IOException {
Response invokedResponse;
if (this.attachment.getMethodParameters().isEmpty()) {
invokedResponse = (Resp... | [
"protected",
"Response",
"invokeController",
"(",
"HttpServerExchange",
"exchange",
",",
"Response",
"response",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"MangooTemplateEngineException",
",",
"IOException",
"{",
"Response",
"invokedRespo... | Invokes the controller methods and retrieves the response which
is later send to the client
@param exchange The Undertow HttpServerExchange
@return A response object
@throws IllegalAccessException
@throws InvocationTargetException
@throws IOException
@throws TemplateException
@throws MangooTemplateEngineException | [
"Invokes",
"the",
"controller",
"methods",
"and",
"retrieves",
"the",
"response",
"which",
"is",
"later",
"send",
"to",
"the",
"client"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java#L135-L179 |
100,175 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java | RequestHandler.getTemplatePath | protected String getTemplatePath(Response response) {
return StringUtils.isBlank(response.getTemplate()) ? (this.attachment.getControllerClassName() + "/" + this.attachment.getTemplateEngine().getTemplateName(this.attachment.getControllerMethodName())) : response.getTemplate();
} | java | protected String getTemplatePath(Response response) {
return StringUtils.isBlank(response.getTemplate()) ? (this.attachment.getControllerClassName() + "/" + this.attachment.getTemplateEngine().getTemplateName(this.attachment.getControllerMethodName())) : response.getTemplate();
} | [
"protected",
"String",
"getTemplatePath",
"(",
"Response",
"response",
")",
"{",
"return",
"StringUtils",
".",
"isBlank",
"(",
"response",
".",
"getTemplate",
"(",
")",
")",
"?",
"(",
"this",
".",
"attachment",
".",
"getControllerClassName",
"(",
")",
"+",
"... | Returns the complete path to the template based on the
controller and method name
@param response The current response
@return A case-sensitive template path, e.g. /ApplicationController/index.ftl | [
"Returns",
"the",
"complete",
"path",
"to",
"the",
"template",
"based",
"on",
"the",
"controller",
"and",
"method",
"name"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java#L189-L191 |
100,176 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java | RequestHandler.executeFilter | protected Response executeFilter(List<Annotation> annotations, Response response) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
for (final Annotation annotation : annotations) {
final FilterWith filterWith = (FilterWith) annotation;
for (final Class<?>... | java | protected Response executeFilter(List<Annotation> annotations, Response response) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
for (final Annotation annotation : annotations) {
final FilterWith filterWith = (FilterWith) annotation;
for (final Class<?>... | [
"protected",
"Response",
"executeFilter",
"(",
"List",
"<",
"Annotation",
">",
"annotations",
",",
"Response",
"response",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"for",
"(",
"final",
"Annotation",
... | Executes all filters on controller and method level
@param annotations An array of @FilterWith annotated classes and methods
@param response
@return True if the request should continue after filter execution, false otherwise
@throws NoSuchMethodException
@throws IllegalAccessException
@throws InvocationTargetExceptio... | [
"Executes",
"all",
"filters",
"on",
"controller",
"and",
"method",
"level"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java#L291-L305 |
100,177 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java | RequestHandler.getRequestBody | protected String getRequestBody(HttpServerExchange exchange) throws IOException {
String body = "";
if (RequestUtils.isPostPutPatch(exchange)) {
exchange.startBlocking();
body = IOUtils.toString(exchange.getInputStream(), Default.ENCODING.toString());
}
return bo... | java | protected String getRequestBody(HttpServerExchange exchange) throws IOException {
String body = "";
if (RequestUtils.isPostPutPatch(exchange)) {
exchange.startBlocking();
body = IOUtils.toString(exchange.getInputStream(), Default.ENCODING.toString());
}
return bo... | [
"protected",
"String",
"getRequestBody",
"(",
"HttpServerExchange",
"exchange",
")",
"throws",
"IOException",
"{",
"String",
"body",
"=",
"\"\"",
";",
"if",
"(",
"RequestUtils",
".",
"isPostPutPatch",
"(",
"exchange",
")",
")",
"{",
"exchange",
".",
"startBlocki... | Retrieves the complete request body from the request
@param exchange The Undertow HttpServerExchange
@return A body object containing the request body
@throws IOException | [
"Retrieves",
"the",
"complete",
"request",
"body",
"from",
"the",
"request"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/RequestHandler.java#L315-L323 |
100,178 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.isStarted | public boolean isStarted() throws MangooSchedulerException {
boolean started;
try {
started = this.quartzScheduler != null && this.quartzScheduler.isStarted();
} catch (SchedulerException e) {
throw new MangooSchedulerException(e);
}
return starte... | java | public boolean isStarted() throws MangooSchedulerException {
boolean started;
try {
started = this.quartzScheduler != null && this.quartzScheduler.isStarted();
} catch (SchedulerException e) {
throw new MangooSchedulerException(e);
}
return starte... | [
"public",
"boolean",
"isStarted",
"(",
")",
"throws",
"MangooSchedulerException",
"{",
"boolean",
"started",
";",
"try",
"{",
"started",
"=",
"this",
".",
"quartzScheduler",
"!=",
"null",
"&&",
"this",
".",
"quartzScheduler",
".",
"isStarted",
"(",
")",
";",
... | Checks if the scheduler is initialized and started
@return true if the scheduler is started, false otherwise
@throws MangooSchedulerException if an error occurred accessing the scheduler | [
"Checks",
"if",
"the",
"scheduler",
"is",
"initialized",
"and",
"started"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L75-L84 |
100,179 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.schedule | public void schedule(JobDetail jobDetail, Trigger trigger) throws MangooSchedulerException {
Objects.requireNonNull(jobDetail, Required.JOB_DETAIL.toString());
Objects.requireNonNull(trigger, Required.TRIGGER.toString());
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString()... | java | public void schedule(JobDetail jobDetail, Trigger trigger) throws MangooSchedulerException {
Objects.requireNonNull(jobDetail, Required.JOB_DETAIL.toString());
Objects.requireNonNull(trigger, Required.TRIGGER.toString());
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString()... | [
"public",
"void",
"schedule",
"(",
"JobDetail",
"jobDetail",
",",
"Trigger",
"trigger",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"jobDetail",
",",
"Required",
".",
"JOB_DETAIL",
".",
"toString",
"(",
")",
")",
";",
... | Adds a new job with a given JobDetail and Trigger to the scheduler
@param jobDetail The JobDetail for the Job
@param trigger The Trigger for the job
@throws MangooSchedulerException when accessing the scheduler results in an error | [
"Adds",
"a",
"new",
"job",
"with",
"a",
"given",
"JobDetail",
"and",
"Trigger",
"to",
"the",
"scheduler"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L149-L159 |
100,180 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.getAllJobs | @SuppressWarnings("unchecked")
public List<io.mangoo.models.Job> getAllJobs() throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
List<io.mangoo.models.Job> jobs = new ArrayList<>();
try {
for (JobKey jobKey : ge... | java | @SuppressWarnings("unchecked")
public List<io.mangoo.models.Job> getAllJobs() throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
List<io.mangoo.models.Job> jobs = new ArrayList<>();
try {
for (JobKey jobKey : ge... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"io",
".",
"mangoo",
".",
"models",
".",
"Job",
">",
"getAllJobs",
"(",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"this",
".",
"quartzSchedu... | Retrieves a list of all jobs and their current status
@return List of io.mangoo.models.Job objects
@throws MangooSchedulerException if an error occurs during access to the Quartz Scheduler | [
"Retrieves",
"a",
"list",
"of",
"all",
"jobs",
"and",
"their",
"current",
"status"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L167-L185 |
100,181 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.getJobKey | public JobKey getJobKey(String name) throws MangooSchedulerException {
Objects.requireNonNull(name, Required.NAME.toString());
return getAllJobKeys().stream()
.filter(jobKey -> jobKey.getName().equalsIgnoreCase(name))
.findFirst()
.orElse(null);
... | java | public JobKey getJobKey(String name) throws MangooSchedulerException {
Objects.requireNonNull(name, Required.NAME.toString());
return getAllJobKeys().stream()
.filter(jobKey -> jobKey.getName().equalsIgnoreCase(name))
.findFirst()
.orElse(null);
... | [
"public",
"JobKey",
"getJobKey",
"(",
"String",
"name",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"name",
",",
"Required",
".",
"NAME",
".",
"toString",
"(",
")",
")",
";",
"return",
"getAllJobKeys",
"(",
")",
"."... | Retrieves a JobKey by it given name
@param name The name of the Job in the Scheduler
@return Optional of JobKey
@throws MangooSchedulerException if retrieving the job fails | [
"Retrieves",
"a",
"JobKey",
"by",
"it",
"given",
"name"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L246-L253 |
100,182 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.executeJob | public void executeJob(String jobName) throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
Objects.requireNonNull(jobName, Required.JOB_NAME.toString());
try {
for (JobKey jobKey : getAllJobKeys()) {
... | java | public void executeJob(String jobName) throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
Objects.requireNonNull(jobName, Required.JOB_NAME.toString());
try {
for (JobKey jobKey : getAllJobKeys()) {
... | [
"public",
"void",
"executeJob",
"(",
"String",
"jobName",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"this",
".",
"quartzScheduler",
",",
"Required",
".",
"SCHEDULER",
".",
"toString",
"(",
")",
")",
";",
"Objects",
... | Executes a single Quartz Scheduler job right away only once
@param jobName The name of the job to execute
@throws MangooSchedulerException if an error occurs during execution of the job | [
"Executes",
"a",
"single",
"Quartz",
"Scheduler",
"job",
"right",
"away",
"only",
"once"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L261-L274 |
100,183 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.getAllJobKeys | public List<JobKey> getAllJobKeys() throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
List<JobKey> jobKeys = new ArrayList<>();
try {
for (String groupName : this.quartzScheduler.getJobGroupNames()) {
... | java | public List<JobKey> getAllJobKeys() throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
List<JobKey> jobKeys = new ArrayList<>();
try {
for (String groupName : this.quartzScheduler.getJobGroupNames()) {
... | [
"public",
"List",
"<",
"JobKey",
">",
"getAllJobKeys",
"(",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"this",
".",
"quartzScheduler",
",",
"Required",
".",
"SCHEDULER",
".",
"toString",
"(",
")",
")",
";",
"List",
... | Retrieves a list of all JobKeys from the Quartz Scheduler
@return List of all JobKey objects
@throws MangooSchedulerException if an errors occurs during access to the scheduler | [
"Retrieves",
"a",
"list",
"of",
"all",
"JobKeys",
"from",
"the",
"Quartz",
"Scheduler"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L282-L295 |
100,184 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java | Scheduler.changeState | public void changeState(String jobName) throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
try {
for (JobKey jobKey : getAllJobKeys()) {
if (jobKey.getName().equalsIgnoreCase(jobName)) {
... | java | public void changeState(String jobName) throws MangooSchedulerException {
Objects.requireNonNull(this.quartzScheduler, Required.SCHEDULER.toString());
try {
for (JobKey jobKey : getAllJobKeys()) {
if (jobKey.getName().equalsIgnoreCase(jobName)) {
... | [
"public",
"void",
"changeState",
"(",
"String",
"jobName",
")",
"throws",
"MangooSchedulerException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"this",
".",
"quartzScheduler",
",",
"Required",
".",
"SCHEDULER",
".",
"toString",
"(",
")",
")",
";",
"try",
"{"... | Changes the state of a normally running job from pause to resume or resume to pause
@param jobName The name of the job
@throws MangooSchedulerException if an error occurs during access to the quartz scheduler | [
"Changes",
"the",
"state",
"of",
"a",
"normally",
"running",
"job",
"from",
"pause",
"to",
"resume",
"or",
"resume",
"to",
"pause"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/scheduler/Scheduler.java#L303-L320 |
100,185 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java | AuthenticationHandler.endRequest | private void endRequest(HttpServerExchange exchange, String redirect) {
exchange.setStatusCode(StatusCodes.FOUND);
Server.headers()
.entrySet()
.stream()
.filter(entry -> StringUtils.isNotBlank(entry.getValue()))
.forEach(entry -> exchange.getResp... | java | private void endRequest(HttpServerExchange exchange, String redirect) {
exchange.setStatusCode(StatusCodes.FOUND);
Server.headers()
.entrySet()
.stream()
.filter(entry -> StringUtils.isNotBlank(entry.getValue()))
.forEach(entry -> exchange.getResp... | [
"private",
"void",
"endRequest",
"(",
"HttpServerExchange",
"exchange",
",",
"String",
"redirect",
")",
"{",
"exchange",
".",
"setStatusCode",
"(",
"StatusCodes",
".",
"FOUND",
")",
";",
"Server",
".",
"headers",
"(",
")",
".",
"entrySet",
"(",
")",
".",
"... | Ends the current request by sending a HTTP 302 status code and a direct to the given URL
@param exchange The HttpServerExchange | [
"Ends",
"the",
"current",
"request",
"by",
"sending",
"a",
"HTTP",
"302",
"status",
"code",
"and",
"a",
"direct",
"to",
"the",
"given",
"URL"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java#L62-L73 |
100,186 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java | AuthenticationHandler.endRequest | private void endRequest(HttpServerExchange exchange) {
exchange.setStatusCode(StatusCodes.FORBIDDEN);
Server.headers()
.entrySet()
.stream()
.filter(entry -> StringUtils.isNotBlank(entry.getValue()))
.forEach(entry -> exchange.getResponseHeaders()... | java | private void endRequest(HttpServerExchange exchange) {
exchange.setStatusCode(StatusCodes.FORBIDDEN);
Server.headers()
.entrySet()
.stream()
.filter(entry -> StringUtils.isNotBlank(entry.getValue()))
.forEach(entry -> exchange.getResponseHeaders()... | [
"private",
"void",
"endRequest",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"exchange",
".",
"setStatusCode",
"(",
"StatusCodes",
".",
"FORBIDDEN",
")",
";",
"Server",
".",
"headers",
"(",
")",
".",
"entrySet",
"(",
")",
".",
"stream",
"(",
")",
".",... | Ends the current request by sending a HTTP 403 status code and the default forbidden template
@param exchange The HttpServerExchange | [
"Ends",
"the",
"current",
"request",
"by",
"sending",
"a",
"HTTP",
"403",
"status",
"code",
"and",
"the",
"default",
"forbidden",
"template"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/handlers/AuthenticationHandler.java#L79-L89 |
100,187 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java | RequestUtils.getRequestParameters | public static Map<String, String> getRequestParameters(HttpServerExchange exchange) {
Objects.requireNonNull(exchange, Required.HTTP_SERVER_EXCHANGE.toString());
final Map<String, String> requestParamater = new HashMap<>();
final Map<String, Deque<String>> queryParameters = exchange.getQueryPar... | java | public static Map<String, String> getRequestParameters(HttpServerExchange exchange) {
Objects.requireNonNull(exchange, Required.HTTP_SERVER_EXCHANGE.toString());
final Map<String, String> requestParamater = new HashMap<>();
final Map<String, Deque<String>> queryParameters = exchange.getQueryPar... | [
"public",
"static",
"Map",
"<",
"String",
",",
"String",
">",
"getRequestParameters",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"exchange",
",",
"Required",
".",
"HTTP_SERVER_EXCHANGE",
".",
"toString",
"(",
")",
")"... | Converts request and query parameter into a single map
@param exchange The Undertow HttpServerExchange
@return A single map contain both request and query parameter | [
"Converts",
"request",
"and",
"query",
"parameter",
"into",
"a",
"single",
"map"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L78-L87 |
100,188 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java | RequestUtils.isPostPutPatch | public static boolean isPostPutPatch(HttpServerExchange exchange) {
Objects.requireNonNull(exchange, Required.HTTP_SERVER_EXCHANGE.toString());
return (Methods.POST).equals(exchange.getRequestMethod()) || (Methods.PUT).equals(exchange.getRequestMethod()) || (Methods.PATCH).equals(exchange.getRequestMet... | java | public static boolean isPostPutPatch(HttpServerExchange exchange) {
Objects.requireNonNull(exchange, Required.HTTP_SERVER_EXCHANGE.toString());
return (Methods.POST).equals(exchange.getRequestMethod()) || (Methods.PUT).equals(exchange.getRequestMethod()) || (Methods.PATCH).equals(exchange.getRequestMet... | [
"public",
"static",
"boolean",
"isPostPutPatch",
"(",
"HttpServerExchange",
"exchange",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"exchange",
",",
"Required",
".",
"HTTP_SERVER_EXCHANGE",
".",
"toString",
"(",
")",
")",
";",
"return",
"(",
"Methods",
".",... | Checks if the request is a POST, PUT or PATCH request
@param exchange The Undertow HttpServerExchange
@return True if the request is a POST, PUT or PATCH request, false otherwise | [
"Checks",
"if",
"the",
"request",
"is",
"a",
"POST",
"PUT",
"or",
"PATCH",
"request"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L95-L99 |
100,189 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java | RequestUtils.hasValidAuthentication | public static boolean hasValidAuthentication(String cookie) {
boolean valid = false;
if (StringUtils.isNotBlank(cookie)) {
Config config = Application.getInstance(Config.class);
String value = null;
String [] contents = cookie.split(";");
for (String cont... | java | public static boolean hasValidAuthentication(String cookie) {
boolean valid = false;
if (StringUtils.isNotBlank(cookie)) {
Config config = Application.getInstance(Config.class);
String value = null;
String [] contents = cookie.split(";");
for (String cont... | [
"public",
"static",
"boolean",
"hasValidAuthentication",
"(",
"String",
"cookie",
")",
"{",
"boolean",
"valid",
"=",
"false",
";",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"cookie",
")",
")",
"{",
"Config",
"config",
"=",
"Application",
".",
"getIns... | Checks if the given header contains a valid authentication
@param cookie The cookie to parse
@return True if the cookie contains a valid authentication, false otherwise | [
"Checks",
"if",
"the",
"given",
"header",
"contains",
"a",
"valid",
"authentication"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L121-L154 |
100,190 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java | RequestUtils.wrapBasicAuthentication | public static HttpHandler wrapBasicAuthentication(HttpHandler httpHandler, String username, String password) {
Objects.requireNonNull(httpHandler, Required.HTTP_HANDLER.toString());
Objects.requireNonNull(username, Required.USERNAME.toString());
Objects.requireNonNull(password, Required.PASSWORD... | java | public static HttpHandler wrapBasicAuthentication(HttpHandler httpHandler, String username, String password) {
Objects.requireNonNull(httpHandler, Required.HTTP_HANDLER.toString());
Objects.requireNonNull(username, Required.USERNAME.toString());
Objects.requireNonNull(password, Required.PASSWORD... | [
"public",
"static",
"HttpHandler",
"wrapBasicAuthentication",
"(",
"HttpHandler",
"httpHandler",
",",
"String",
"username",
",",
"String",
"password",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"httpHandler",
",",
"Required",
".",
"HTTP_HANDLER",
".",
"toStrin... | Adds a Wrapper to the handler when the request requires authentication
@param httpHandler The Handler to wrap
@param username The username to use
@param password The password to use
@return An HttpHandler wrapped through BasicAuthentication | [
"Adds",
"a",
"Wrapper",
"to",
"the",
"handler",
"when",
"the",
"request",
"requires",
"authentication"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L211-L221 |
100,191 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java | RequestUtils.getOperation | public static String getOperation(HttpString method) {
String operation = "";
if (Methods.POST.equals(method)) {
operation = WRITE;
} else if (Methods.PUT.equals(method)) {
operation = WRITE;
} else if (Methods.DELETE.equals(method)) {
operati... | java | public static String getOperation(HttpString method) {
String operation = "";
if (Methods.POST.equals(method)) {
operation = WRITE;
} else if (Methods.PUT.equals(method)) {
operation = WRITE;
} else if (Methods.DELETE.equals(method)) {
operati... | [
"public",
"static",
"String",
"getOperation",
"(",
"HttpString",
"method",
")",
"{",
"String",
"operation",
"=",
"\"\"",
";",
"if",
"(",
"Methods",
".",
"POST",
".",
"equals",
"(",
"method",
")",
")",
"{",
"operation",
"=",
"WRITE",
";",
"}",
"else",
"... | Return if a given HTTP method results in a read or write request to a resource
GET = read
POST = write
PUT = write
DELETE = write
PATCH = write
OPTIONS = read
HEAD = read
@param method The HTTP method
@return read or write if HTTP method is found, blank otherwise | [
"Return",
"if",
"a",
"given",
"HTTP",
"method",
"results",
"in",
"a",
"read",
"or",
"write",
"request",
"to",
"a",
"resource"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/RequestUtils.java#L237-L259 |
100,192 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.decrypt | public String decrypt(String encrytedText, String key) {
Objects.requireNonNull(encrytedText, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(key, Required.KEY.toString());
CipherParameters cipherParameters = new ParametersWithRandom(new KeyParameter(getSizedSecret(key).getBytes(Sta... | java | public String decrypt(String encrytedText, String key) {
Objects.requireNonNull(encrytedText, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(key, Required.KEY.toString());
CipherParameters cipherParameters = new ParametersWithRandom(new KeyParameter(getSizedSecret(key).getBytes(Sta... | [
"public",
"String",
"decrypt",
"(",
"String",
"encrytedText",
",",
"String",
"key",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"encrytedText",
",",
"Required",
".",
"ENCRYPTED_TEXT",
".",
"toString",
"(",
")",
")",
";",
"Objects",
".",
"requireNonNull",
... | Decrypts an given encrypted text using the given key
@param encrytedText The encrypted text
@param key The encryption key
@return The clear text or null if decryption fails | [
"Decrypts",
"an",
"given",
"encrypted",
"text",
"using",
"the",
"given",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L84-L92 |
100,193 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.encrypt | public String encrypt(final String plainText, final String key) {
Objects.requireNonNull(plainText, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(key, Required.KEY.toString());
CipherParameters cipherParameters = new ParametersWithRandom(new KeyParameter(getSizedSecret(key).getBytes(S... | java | public String encrypt(final String plainText, final String key) {
Objects.requireNonNull(plainText, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(key, Required.KEY.toString());
CipherParameters cipherParameters = new ParametersWithRandom(new KeyParameter(getSizedSecret(key).getBytes(S... | [
"public",
"String",
"encrypt",
"(",
"final",
"String",
"plainText",
",",
"final",
"String",
"key",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"plainText",
",",
"Required",
".",
"PLAIN_TEXT",
".",
"toString",
"(",
")",
")",
";",
"Objects",
".",
"requi... | Encrypts a given plain text using the given key
Encryption is done by using AES and CBC Cipher and a key length of 256 bit
@param plainText The plain text to encrypt
@param key The key to use for encryption
@return The encrypted text or null if encryption fails | [
"Encrypts",
"a",
"given",
"plain",
"text",
"using",
"the",
"given",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L117-L125 |
100,194 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.cipherData | private byte[] cipherData(final byte[] data) {
byte[] result = null;
try {
final byte[] buffer = new byte[this.paddedBufferedBlockCipher.getOutputSize(data.length)];
final int processedBytes = this.paddedBufferedBlockCipher.processBytes(data, 0, data.length, buffer, 0);
... | java | private byte[] cipherData(final byte[] data) {
byte[] result = null;
try {
final byte[] buffer = new byte[this.paddedBufferedBlockCipher.getOutputSize(data.length)];
final int processedBytes = this.paddedBufferedBlockCipher.processBytes(data, 0, data.length, buffer, 0);
... | [
"private",
"byte",
"[",
"]",
"cipherData",
"(",
"final",
"byte",
"[",
"]",
"data",
")",
"{",
"byte",
"[",
"]",
"result",
"=",
"null",
";",
"try",
"{",
"final",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"this",
".",
"paddedBufferedBlockCiph... | Encrypts or decrypts a given byte array of data
@param data The data to encrypt or decrypt
@return A clear text or encrypted byte array | [
"Encrypts",
"or",
"decrypts",
"a",
"given",
"byte",
"array",
"of",
"data"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L133-L148 |
100,195 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.generateKeyPair | public KeyPair generateKeyPair() {
KeyPair keyPair = null;
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(ALGORITHM);
keyPairGenerator.initialize(KEYLENGTH);
keyPair = keyPairGenerator.generateKeyPair();
} catch (NoSuchAlgorithmExceptio... | java | public KeyPair generateKeyPair() {
KeyPair keyPair = null;
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(ALGORITHM);
keyPairGenerator.initialize(KEYLENGTH);
keyPair = keyPairGenerator.generateKeyPair();
} catch (NoSuchAlgorithmExceptio... | [
"public",
"KeyPair",
"generateKeyPair",
"(",
")",
"{",
"KeyPair",
"keyPair",
"=",
"null",
";",
"try",
"{",
"KeyPairGenerator",
"keyPairGenerator",
"=",
"KeyPairGenerator",
".",
"getInstance",
"(",
"ALGORITHM",
")",
";",
"keyPairGenerator",
".",
"initialize",
"(",
... | Generate key which contains a pair of private and public key using 4096 bytes
@return key pair | [
"Generate",
"key",
"which",
"contains",
"a",
"pair",
"of",
"private",
"and",
"public",
"key",
"using",
"4096",
"bytes"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L162-L173 |
100,196 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.encrypt | public byte[] encrypt(byte[] text, PublicKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(text, Required.PUBLIC_KEY.toString());
byte[] encrypt = null;
try {
Cipher cipher = Cipher.getIns... | java | public byte[] encrypt(byte[] text, PublicKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(text, Required.PUBLIC_KEY.toString());
byte[] encrypt = null;
try {
Cipher cipher = Cipher.getIns... | [
"public",
"byte",
"[",
"]",
"encrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"PublicKey",
"key",
")",
"throws",
"MangooEncryptionException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"text",
",",
"Required",
".",
"PLAIN_TEXT",
".",
"toString",
"(",
")",
")... | Encrypt a text using public key
@param text The plain text
@param key The public key
@return Encrypted text
@throws MangooEncryptionException if encryption fails | [
"Encrypt",
"a",
"text",
"using",
"public",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L184-L198 |
100,197 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.encrypt | public String encrypt(String text, PublicKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(text, Required.PUBLIC_KEY.toString());
String encrypt = null;
try {
byte[] cipherText = encrypt(t... | java | public String encrypt(String text, PublicKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.PLAIN_TEXT.toString());
Objects.requireNonNull(text, Required.PUBLIC_KEY.toString());
String encrypt = null;
try {
byte[] cipherText = encrypt(t... | [
"public",
"String",
"encrypt",
"(",
"String",
"text",
",",
"PublicKey",
"key",
")",
"throws",
"MangooEncryptionException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"text",
",",
"Required",
".",
"PLAIN_TEXT",
".",
"toString",
"(",
")",
")",
";",
"Objects",
... | Encrypt a text using public key. The result is encoded to Base64.
@param text The plain text
@param key The public key
@return Encrypted string as base64
@throws MangooEncryptionException if encryption fails | [
"Encrypt",
"a",
"text",
"using",
"public",
"key",
".",
"The",
"result",
"is",
"encoded",
"to",
"Base64",
"."
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L209-L222 |
100,198 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.decrypt | public byte[] decrypt(byte[] text, PrivateKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(text, Required.PRIVATE_KEY.toString());
byte[] decrypt = null;
try {
Cipher cipher = Cipher.getInsta... | java | public byte[] decrypt(byte[] text, PrivateKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(text, Required.PRIVATE_KEY.toString());
byte[] decrypt = null;
try {
Cipher cipher = Cipher.getInsta... | [
"public",
"byte",
"[",
"]",
"decrypt",
"(",
"byte",
"[",
"]",
"text",
",",
"PrivateKey",
"key",
")",
"throws",
"MangooEncryptionException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"text",
",",
"Required",
".",
"ENCRYPTED_TEXT",
".",
"toString",
"(",
")",... | Decrypt text using private key
@param text The encrypted text
@param key The private key
@return The unencrypted text
@throws MangooEncryptionException if decryption fails | [
"Decrypt",
"text",
"using",
"private",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L233-L247 |
100,199 | svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java | Crypto.decrypt | public String decrypt(String text, PrivateKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(text, Required.PRIVATE_KEY.toString());
String decrypt = null;
try {
byte[] dectyptedText = ... | java | public String decrypt(String text, PrivateKey key) throws MangooEncryptionException {
Objects.requireNonNull(text, Required.ENCRYPTED_TEXT.toString());
Objects.requireNonNull(text, Required.PRIVATE_KEY.toString());
String decrypt = null;
try {
byte[] dectyptedText = ... | [
"public",
"String",
"decrypt",
"(",
"String",
"text",
",",
"PrivateKey",
"key",
")",
"throws",
"MangooEncryptionException",
"{",
"Objects",
".",
"requireNonNull",
"(",
"text",
",",
"Required",
".",
"ENCRYPTED_TEXT",
".",
"toString",
"(",
")",
")",
";",
"Object... | Decrypt Base64 encoded text using private key
@param text The encrypted text, encoded as Base64
@param key The private key
@return The plain text encoded as UTF8
@throws MangooEncryptionException if decryption fails | [
"Decrypt",
"Base64",
"encoded",
"text",
"using",
"private",
"key"
] | b3beb6d09510dbbab0ed947d5069c463e1fda6e7 | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/crypto/Crypto.java#L258-L271 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.