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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
108,800 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.createImportJob | public RESTImport createImportJob(String workSpaceName, String dataStoreName)
throws Exception {
if (StringUtils.isEmpty(workSpaceName)) {
throw new GeoServerRESTImporterException("No workspace given. Please provide a "
+ "workspace to import the data in.");
}
... | java | public RESTImport createImportJob(String workSpaceName, String dataStoreName)
throws Exception {
if (StringUtils.isEmpty(workSpaceName)) {
throw new GeoServerRESTImporterException("No workspace given. Please provide a "
+ "workspace to import the data in.");
}
... | [
"public",
"RESTImport",
"createImportJob",
"(",
"String",
"workSpaceName",
",",
"String",
"dataStoreName",
")",
"throws",
"Exception",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"workSpaceName",
")",
")",
"{",
"throw",
"new",
"GeoServerRESTImporterException... | Create a new import job. | [
"Create",
"a",
"new",
"import",
"job",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L106-L149 |
108,801 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.createReprojectTransformTask | public boolean createReprojectTransformTask(Integer importJobId, Integer taskId,
String sourceSrs, String targetSrs) throws URISyntaxException, HttpException {
RESTReprojectTransform transformTask = new RESTReprojectTransform();
if (StringUtils.isNotEmpty(... | java | public boolean createReprojectTransformTask(Integer importJobId, Integer taskId,
String sourceSrs, String targetSrs) throws URISyntaxException, HttpException {
RESTReprojectTransform transformTask = new RESTReprojectTransform();
if (StringUtils.isNotEmpty(... | [
"public",
"boolean",
"createReprojectTransformTask",
"(",
"Integer",
"importJobId",
",",
"Integer",
"taskId",
",",
"String",
"sourceSrs",
",",
"String",
"targetSrs",
")",
"throws",
"URISyntaxException",
",",
"HttpException",
"{",
"RESTReprojectTransform",
"transformTask",... | Create a reprojection task. | [
"Create",
"a",
"reprojection",
"task",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L155-L164 |
108,802 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.uploadFile | public RESTImportTaskList uploadFile(Integer importJobId, File file, String sourceSrs) throws Exception {
LOG.debug("Uploading file " + file.getName() + " to import job " + importJobId);
Response httpResponse = HttpUtil.post(
this.addEndPoint(importJobId + "/tasks"),
file,
... | java | public RESTImportTaskList uploadFile(Integer importJobId, File file, String sourceSrs) throws Exception {
LOG.debug("Uploading file " + file.getName() + " to import job " + importJobId);
Response httpResponse = HttpUtil.post(
this.addEndPoint(importJobId + "/tasks"),
file,
... | [
"public",
"RESTImportTaskList",
"uploadFile",
"(",
"Integer",
"importJobId",
",",
"File",
"file",
",",
"String",
"sourceSrs",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"debug",
"(",
"\"Uploading file \"",
"+",
"file",
".",
"getName",
"(",
")",
"+",
"\" to i... | Upload an import file. | [
"Upload",
"an",
"import",
"file",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L208-L271 |
108,803 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.updateImportTask | public boolean updateImportTask(int importJobId, int importTaskId,
AbstractRESTEntity updateTaskEntity) throws Exception {
LOG.debug("Updating the import task " + importTaskId + " in job " + importJobId +
" with " + updateTaskEntity);
Response httpRespon... | java | public boolean updateImportTask(int importJobId, int importTaskId,
AbstractRESTEntity updateTaskEntity) throws Exception {
LOG.debug("Updating the import task " + importTaskId + " in job " + importJobId +
" with " + updateTaskEntity);
Response httpRespon... | [
"public",
"boolean",
"updateImportTask",
"(",
"int",
"importJobId",
",",
"int",
"importTaskId",
",",
"AbstractRESTEntity",
"updateTaskEntity",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"debug",
"(",
"\"Updating the import task \"",
"+",
"importTaskId",
"+",
"\" in ... | Updates the given import task. | [
"Updates",
"the",
"given",
"import",
"task",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L276-L299 |
108,804 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.deleteImportJob | public boolean deleteImportJob(Integer importJobId) throws URISyntaxException, HttpException {
LOG.debug("Deleting the import job " + importJobId);
Response httpResponse = HttpUtil.delete(
this.addEndPoint(importJobId.toString()),
this.username,
this.password);
... | java | public boolean deleteImportJob(Integer importJobId) throws URISyntaxException, HttpException {
LOG.debug("Deleting the import job " + importJobId);
Response httpResponse = HttpUtil.delete(
this.addEndPoint(importJobId.toString()),
this.username,
this.password);
... | [
"public",
"boolean",
"deleteImportJob",
"(",
"Integer",
"importJobId",
")",
"throws",
"URISyntaxException",
",",
"HttpException",
"{",
"LOG",
".",
"debug",
"(",
"\"Deleting the import job \"",
"+",
"importJobId",
")",
";",
"Response",
"httpResponse",
"=",
"HttpUtil",
... | Deletes an importJob. | [
"Deletes",
"an",
"importJob",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L304-L322 |
108,805 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.runImportJob | public boolean runImportJob(Integer importJobId) throws
UnsupportedEncodingException, URISyntaxException, HttpException {
LOG.debug("Starting the import for job " + importJobId);
Response httpResponse = HttpUtil.post(
this.addEndPoint(Integer.toString(importJobId)),
thi... | java | public boolean runImportJob(Integer importJobId) throws
UnsupportedEncodingException, URISyntaxException, HttpException {
LOG.debug("Starting the import for job " + importJobId);
Response httpResponse = HttpUtil.post(
this.addEndPoint(Integer.toString(importJobId)),
thi... | [
"public",
"boolean",
"runImportJob",
"(",
"Integer",
"importJobId",
")",
"throws",
"UnsupportedEncodingException",
",",
"URISyntaxException",
",",
"HttpException",
"{",
"LOG",
".",
"debug",
"(",
"\"Starting the import for job \"",
"+",
"importJobId",
")",
";",
"Response... | Run a previously configured import job. | [
"Run",
"a",
"previously",
"configured",
"import",
"job",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L327-L347 |
108,806 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.getLayer | public RESTLayer getLayer(Integer importJobId, Integer taskId) throws Exception {
Response httpResponse = HttpUtil.get(
this.addEndPoint(importJobId + "/tasks/" + taskId + "/layer"),
this.username,
this.password
);
return (RESTLayer) this.asEntity(httpRespons... | java | public RESTLayer getLayer(Integer importJobId, Integer taskId) throws Exception {
Response httpResponse = HttpUtil.get(
this.addEndPoint(importJobId + "/tasks/" + taskId + "/layer"),
this.username,
this.password
);
return (RESTLayer) this.asEntity(httpRespons... | [
"public",
"RESTLayer",
"getLayer",
"(",
"Integer",
"importJobId",
",",
"Integer",
"taskId",
")",
"throws",
"Exception",
"{",
"Response",
"httpResponse",
"=",
"HttpUtil",
".",
"get",
"(",
"this",
".",
"addEndPoint",
"(",
"importJobId",
"+",
"\"/tasks/\"",
"+",
... | Get a layer. | [
"Get",
"a",
"layer",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L352-L360 |
108,807 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.getAllImportedLayers | public List<RESTLayer> getAllImportedLayers(Integer importJobId, List<RESTImportTask> tasks) throws Exception {
ArrayList<RESTLayer> layers = new ArrayList<RESTLayer>();
for (RESTImportTask task : tasks) {
RESTImportTask refreshedTask = this.getRESTImportTask(importJobId, task.getId());
... | java | public List<RESTLayer> getAllImportedLayers(Integer importJobId, List<RESTImportTask> tasks) throws Exception {
ArrayList<RESTLayer> layers = new ArrayList<RESTLayer>();
for (RESTImportTask task : tasks) {
RESTImportTask refreshedTask = this.getRESTImportTask(importJobId, task.getId());
... | [
"public",
"List",
"<",
"RESTLayer",
">",
"getAllImportedLayers",
"(",
"Integer",
"importJobId",
",",
"List",
"<",
"RESTImportTask",
">",
"tasks",
")",
"throws",
"Exception",
"{",
"ArrayList",
"<",
"RESTLayer",
">",
"layers",
"=",
"new",
"ArrayList",
"<",
"REST... | fetch all created Layers of import job | [
"fetch",
"all",
"created",
"Layers",
"of",
"import",
"job"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L365-L386 |
108,808 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.getDataOfImportTask | public RESTData getDataOfImportTask(Integer importJobId, Integer taskId)
throws Exception {
final DeserializationFeature unwrapRootValueFeature = DeserializationFeature.UNWRAP_ROOT_VALUE;
boolean unwrapRootValueFeatureIsEnabled = mapper.isEnabled(unwrapRootValueFeature);
Response httpRe... | java | public RESTData getDataOfImportTask(Integer importJobId, Integer taskId)
throws Exception {
final DeserializationFeature unwrapRootValueFeature = DeserializationFeature.UNWRAP_ROOT_VALUE;
boolean unwrapRootValueFeatureIsEnabled = mapper.isEnabled(unwrapRootValueFeature);
Response httpRe... | [
"public",
"RESTData",
"getDataOfImportTask",
"(",
"Integer",
"importJobId",
",",
"Integer",
"taskId",
")",
"throws",
"Exception",
"{",
"final",
"DeserializationFeature",
"unwrapRootValueFeature",
"=",
"DeserializationFeature",
".",
"UNWRAP_ROOT_VALUE",
";",
"boolean",
"un... | Get the data of an import task. | [
"Get",
"the",
"data",
"of",
"an",
"import",
"task",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L391-L412 |
108,809 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.getRESTImportTask | public RESTImportTask getRESTImportTask(Integer importJobId, Integer taskId) throws
Exception {
Response httpResponse = HttpUtil.get(
this.addEndPoint(importJobId + "/tasks/" + taskId),
this.username,
this.password
);
return (RESTImportTask) this.asEn... | java | public RESTImportTask getRESTImportTask(Integer importJobId, Integer taskId) throws
Exception {
Response httpResponse = HttpUtil.get(
this.addEndPoint(importJobId + "/tasks/" + taskId),
this.username,
this.password
);
return (RESTImportTask) this.asEn... | [
"public",
"RESTImportTask",
"getRESTImportTask",
"(",
"Integer",
"importJobId",
",",
"Integer",
"taskId",
")",
"throws",
"Exception",
"{",
"Response",
"httpResponse",
"=",
"HttpUtil",
".",
"get",
"(",
"this",
".",
"addEndPoint",
"(",
"importJobId",
"+",
"\"/tasks/... | Get an import task. | [
"Get",
"an",
"import",
"task",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L417-L426 |
108,810 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.createTransformTask | private boolean createTransformTask(Integer importJobId, Integer taskId, RESTTransform transformTask)
throws URISyntaxException, HttpException {
LOG.debug("Creating a new transform task for import job" + importJobId + " and task " + taskId);
mapper.disable(SerializationFeature.WRAP_ROOT_VALUE)... | java | private boolean createTransformTask(Integer importJobId, Integer taskId, RESTTransform transformTask)
throws URISyntaxException, HttpException {
LOG.debug("Creating a new transform task for import job" + importJobId + " and task " + taskId);
mapper.disable(SerializationFeature.WRAP_ROOT_VALUE)... | [
"private",
"boolean",
"createTransformTask",
"(",
"Integer",
"importJobId",
",",
"Integer",
"taskId",
",",
"RESTTransform",
"transformTask",
")",
"throws",
"URISyntaxException",
",",
"HttpException",
"{",
"LOG",
".",
"debug",
"(",
"\"Creating a new transform task for impo... | Helper method to create an importer transformTask | [
"Helper",
"method",
"to",
"create",
"an",
"importer",
"transformTask"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L444-L468 |
108,811 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.addPrjFileToArchive | public static File addPrjFileToArchive(File file, String targetCrs)
throws ZipException, IOException, NoSuchAuthorityCodeException, FactoryException {
ZipFile zipFile = new ZipFile(file);
CoordinateReferenceSystem decodedTargetCrs = CRS.decode(targetCrs);
String targetCrsWkt = toSingle... | java | public static File addPrjFileToArchive(File file, String targetCrs)
throws ZipException, IOException, NoSuchAuthorityCodeException, FactoryException {
ZipFile zipFile = new ZipFile(file);
CoordinateReferenceSystem decodedTargetCrs = CRS.decode(targetCrs);
String targetCrsWkt = toSingle... | [
"public",
"static",
"File",
"addPrjFileToArchive",
"(",
"File",
"file",
",",
"String",
"targetCrs",
")",
"throws",
"ZipException",
",",
"IOException",
",",
"NoSuchAuthorityCodeException",
",",
"FactoryException",
"{",
"ZipFile",
"zipFile",
"=",
"new",
"ZipFile",
"("... | Add a projection file to a shapefile zip archive. | [
"Add",
"a",
"projection",
"file",
"to",
"a",
"shapefile",
"zip",
"archive",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L473-L511 |
108,812 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.toSingleLineWKT | public static String toSingleLineWKT(CoordinateReferenceSystem crs) {
String wkt = null;
try {
// this is a lenient transformation, works with polar stereographics too
Formattable formattable = (Formattable) crs;
wkt = formattable.toWKT(0, false);
} catch (Cla... | java | public static String toSingleLineWKT(CoordinateReferenceSystem crs) {
String wkt = null;
try {
// this is a lenient transformation, works with polar stereographics too
Formattable formattable = (Formattable) crs;
wkt = formattable.toWKT(0, false);
} catch (Cla... | [
"public",
"static",
"String",
"toSingleLineWKT",
"(",
"CoordinateReferenceSystem",
"crs",
")",
"{",
"String",
"wkt",
"=",
"null",
";",
"try",
"{",
"// this is a lenient transformation, works with polar stereographics too",
"Formattable",
"formattable",
"=",
"(",
"Formattabl... | Turns the CRS into a single line WKT
@param crs CoordinateReferenceSystem which should be formatted
@return Single line String which can be written to PRJ file | [
"Turns",
"the",
"CRS",
"into",
"a",
"single",
"line",
"WKT"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L519-L531 |
108,813 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.asEntity | private AbstractRESTEntity asEntity(byte[] responseBody, Class<?> clazz)
throws Exception {
AbstractRESTEntity entity = null;
entity = (AbstractRESTEntity) mapper.readValue(responseBody, clazz);
return entity;
} | java | private AbstractRESTEntity asEntity(byte[] responseBody, Class<?> clazz)
throws Exception {
AbstractRESTEntity entity = null;
entity = (AbstractRESTEntity) mapper.readValue(responseBody, clazz);
return entity;
} | [
"private",
"AbstractRESTEntity",
"asEntity",
"(",
"byte",
"[",
"]",
"responseBody",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"throws",
"Exception",
"{",
"AbstractRESTEntity",
"entity",
"=",
"null",
";",
"entity",
"=",
"(",
"AbstractRESTEntity",
")",
"mapper"... | Convert a byte array to an importer REST entity. | [
"Convert",
"a",
"byte",
"array",
"to",
"an",
"importer",
"REST",
"entity",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L536-L544 |
108,814 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.asJSON | private String asJSON(Object entity) {
String entityJson = null;
try {
entityJson = this.mapper.writeValueAsString(entity);
} catch (Exception e) {
LOG.error("Could not parse as JSON: " + e.getMessage());
}
return entityJson;
} | java | private String asJSON(Object entity) {
String entityJson = null;
try {
entityJson = this.mapper.writeValueAsString(entity);
} catch (Exception e) {
LOG.error("Could not parse as JSON: " + e.getMessage());
}
return entityJson;
} | [
"private",
"String",
"asJSON",
"(",
"Object",
"entity",
")",
"{",
"String",
"entityJson",
"=",
"null",
";",
"try",
"{",
"entityJson",
"=",
"this",
".",
"mapper",
".",
"writeValueAsString",
"(",
"entity",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")"... | Convert an object to json. | [
"Convert",
"an",
"object",
"to",
"json",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L549-L560 |
108,815 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java | GeoServerRESTImporter.addEndPoint | private URI addEndPoint(String endPoint) throws URISyntaxException {
if (StringUtils.isEmpty(endPoint) || endPoint.equals("/")) {
return this.baseUri;
}
if (this.baseUri.getPath().endsWith("/") || endPoint.startsWith("/")) {
endPoint = this.baseUri.getPath() + endPoint;... | java | private URI addEndPoint(String endPoint) throws URISyntaxException {
if (StringUtils.isEmpty(endPoint) || endPoint.equals("/")) {
return this.baseUri;
}
if (this.baseUri.getPath().endsWith("/") || endPoint.startsWith("/")) {
endPoint = this.baseUri.getPath() + endPoint;... | [
"private",
"URI",
"addEndPoint",
"(",
"String",
"endPoint",
")",
"throws",
"URISyntaxException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"endPoint",
")",
"||",
"endPoint",
".",
"equals",
"(",
"\"/\"",
")",
")",
"{",
"return",
"this",
".",
"base... | Add an endpoint. | [
"Add",
"an",
"endpoint",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/importer/GeoServerRESTImporter.java#L565-L588 |
108,816 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/data/ResultSet.java | ResultSet.error | public static final Map<String, Object> error(String errorMsg, Map additionalReturnValuesMap) {
Map<String, Object> returnMap = new HashMap<String, Object>(3);
returnMap.put("message", errorMsg);
returnMap.put("additionalInfo", additionalReturnValuesMap);
returnMap.put("success", false)... | java | public static final Map<String, Object> error(String errorMsg, Map additionalReturnValuesMap) {
Map<String, Object> returnMap = new HashMap<String, Object>(3);
returnMap.put("message", errorMsg);
returnMap.put("additionalInfo", additionalReturnValuesMap);
returnMap.put("success", false)... | [
"public",
"static",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"error",
"(",
"String",
"errorMsg",
",",
"Map",
"additionalReturnValuesMap",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"returnMap",
"=",
"new",
"HashMap",
"<",
"String",
",",
... | Method returning error message and additional return values
@param errorMsg The error message
@param additionalReturnValuesMap {@link Map} containing additional information
@return Map to use e.g. as {@link org.springframework.http.ResponseEntity} | [
"Method",
"returning",
"error",
"message",
"and",
"additional",
"return",
"values"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/data/ResultSet.java#L60-L68 |
108,817 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/Csv2ExtJsLocaleService.java | Csv2ExtJsLocaleService.detectColumnIndexOfLocale | private int detectColumnIndexOfLocale(String locale, CSVReader csvReader) throws Exception {
int indexOfLocale = -1;
List<String> headerLine = Arrays.asList(ArrayUtils.nullToEmpty(csvReader.readNext()));
if (headerLine == null || headerLine.isEmpty()) {
throw new Exception("CSV loca... | java | private int detectColumnIndexOfLocale(String locale, CSVReader csvReader) throws Exception {
int indexOfLocale = -1;
List<String> headerLine = Arrays.asList(ArrayUtils.nullToEmpty(csvReader.readNext()));
if (headerLine == null || headerLine.isEmpty()) {
throw new Exception("CSV loca... | [
"private",
"int",
"detectColumnIndexOfLocale",
"(",
"String",
"locale",
",",
"CSVReader",
"csvReader",
")",
"throws",
"Exception",
"{",
"int",
"indexOfLocale",
"=",
"-",
"1",
";",
"List",
"<",
"String",
">",
"headerLine",
"=",
"Arrays",
".",
"asList",
"(",
"... | Extracts the column index of the given locale in the CSV file.
@param locale
@param csvReader
@return
@throws IOException
@throws Exception | [
"Extracts",
"the",
"column",
"index",
"of",
"the",
"given",
"locale",
"in",
"the",
"CSV",
"file",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/Csv2ExtJsLocaleService.java#L140-L166 |
108,818 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/HttpProxyService.java | HttpProxyService.isInWhiteList | private boolean isInWhiteList(URL url) {
final String host = url.getHost();
final int port = url.getPort();
final String protocol = url.getProtocol();
final int portToTest = (port != -1) ? port : (StringUtils.equalsIgnoreCase(protocol, "https") ? 443 : 80);
List<String> matchin... | java | private boolean isInWhiteList(URL url) {
final String host = url.getHost();
final int port = url.getPort();
final String protocol = url.getProtocol();
final int portToTest = (port != -1) ? port : (StringUtils.equalsIgnoreCase(protocol, "https") ? 443 : 80);
List<String> matchin... | [
"private",
"boolean",
"isInWhiteList",
"(",
"URL",
"url",
")",
"{",
"final",
"String",
"host",
"=",
"url",
".",
"getHost",
"(",
")",
";",
"final",
"int",
"port",
"=",
"url",
".",
"getPort",
"(",
")",
";",
"final",
"String",
"protocol",
"=",
"url",
".... | Helper method to check whether the URI is contained in the host whitelist provided in list of whitelisted hosts
@param url {@link URI} to check
@return true if contained, false otherwise | [
"Helper",
"method",
"to",
"check",
"whether",
"the",
"URI",
"is",
"contained",
"in",
"the",
"host",
"whitelist",
"provided",
"in",
"list",
"of",
"whitelisted",
"hosts"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/HttpProxyService.java#L317-L342 |
108,819 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/EndpointDocController.java | EndpointDocController.getEndpoints | @RequestMapping(value = "/endpointdoc", method = RequestMethod.GET)
public @ResponseBody
Set<RequestMappingInfo> getEndpoints() {
return this.service.getEndpoints(requestMappingHandlerMapping);
} | java | @RequestMapping(value = "/endpointdoc", method = RequestMethod.GET)
public @ResponseBody
Set<RequestMappingInfo> getEndpoints() {
return this.service.getEndpoints(requestMappingHandlerMapping);
} | [
"@",
"RequestMapping",
"(",
"value",
"=",
"\"/endpointdoc\"",
",",
"method",
"=",
"RequestMethod",
".",
"GET",
")",
"public",
"@",
"ResponseBody",
"Set",
"<",
"RequestMappingInfo",
">",
"getEndpoints",
"(",
")",
"{",
"return",
"this",
".",
"service",
".",
"g... | Provides an overview of all mapped endpoints. | [
"Provides",
"an",
"overview",
"of",
"all",
"mapped",
"endpoints",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/web/EndpointDocController.java#L42-L47 |
108,820 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.findById | public E findById(ID id) {
LOG.trace("Finding " + entityClass.getSimpleName() + " with ID " + id);
return (E) getSession().get(entityClass, id);
} | java | public E findById(ID id) {
LOG.trace("Finding " + entityClass.getSimpleName() + " with ID " + id);
return (E) getSession().get(entityClass, id);
} | [
"public",
"E",
"findById",
"(",
"ID",
"id",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Finding \"",
"+",
"entityClass",
".",
"getSimpleName",
"(",
")",
"+",
"\" with ID \"",
"+",
"id",
")",
";",
"return",
"(",
"E",
")",
"getSession",
"(",
")",
".",
"get"... | Return the real object from the database. Returns null if the object does
not exist.
@param id
@return The object from the database or null if it does not exist
@see http://www.mkyong.com/hibernate/different-between-session-get-and-session-load/ | [
"Return",
"the",
"real",
"object",
"from",
"the",
"database",
".",
"Returns",
"null",
"if",
"the",
"object",
"does",
"not",
"exist",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L89-L92 |
108,821 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.saveOrUpdate | public void saveOrUpdate(E e) {
final Integer id = e.getId();
final boolean hasId = id != null;
String createOrUpdatePrefix = hasId ? "Updating" : "Creating a new";
String idSuffix = hasId ? " with ID " + id : "";
LOG.trace(createOrUpdatePrefix + " instance of " + entityClass.ge... | java | public void saveOrUpdate(E e) {
final Integer id = e.getId();
final boolean hasId = id != null;
String createOrUpdatePrefix = hasId ? "Updating" : "Creating a new";
String idSuffix = hasId ? " with ID " + id : "";
LOG.trace(createOrUpdatePrefix + " instance of " + entityClass.ge... | [
"public",
"void",
"saveOrUpdate",
"(",
"E",
"e",
")",
"{",
"final",
"Integer",
"id",
"=",
"e",
".",
"getId",
"(",
")",
";",
"final",
"boolean",
"hasId",
"=",
"id",
"!=",
"null",
";",
"String",
"createOrUpdatePrefix",
"=",
"hasId",
"?",
"\"Updating\"",
... | Saves or updates the passed entity.
@param e The entity to save or update in the database. | [
"Saves",
"or",
"updates",
"the",
"passed",
"entity",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L203-L214 |
108,822 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.delete | public void delete(E e) {
LOG.trace("Deleting " + entityClass.getSimpleName() + " with ID " + e.getId());
getSession().delete(e);
} | java | public void delete(E e) {
LOG.trace("Deleting " + entityClass.getSimpleName() + " with ID " + e.getId());
getSession().delete(e);
} | [
"public",
"void",
"delete",
"(",
"E",
"e",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Deleting \"",
"+",
"entityClass",
".",
"getSimpleName",
"(",
")",
"+",
"\" with ID \"",
"+",
"e",
".",
"getId",
"(",
")",
")",
";",
"getSession",
"(",
")",
".",
"delete... | Deletes the passed entity.
@param e The entity to remove from the database. | [
"Deletes",
"the",
"passed",
"entity",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L221-L224 |
108,823 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.findByCriteria | @SuppressWarnings("unchecked")
public List<E> findByCriteria(Criterion... criterion) throws HibernateException {
LOG.trace("Finding instances of " + entityClass.getSimpleName()
+ " based on " + criterion.length + " criteria");
Criteria criteria = createDistinctRootEntityCriteria(criteri... | java | @SuppressWarnings("unchecked")
public List<E> findByCriteria(Criterion... criterion) throws HibernateException {
LOG.trace("Finding instances of " + entityClass.getSimpleName()
+ " based on " + criterion.length + " criteria");
Criteria criteria = createDistinctRootEntityCriteria(criteri... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"List",
"<",
"E",
">",
"findByCriteria",
"(",
"Criterion",
"...",
"criterion",
")",
"throws",
"HibernateException",
"{",
"LOG",
".",
"trace",
"(",
"\"Finding instances of \"",
"+",
"entityClass",
".",
... | Gets the results, that match a variable number of passed criterions. Call
this method without arguments to find all entities.
@param criterion A variable number of hibernate criterions
@return Entities matching the passed hibernate criterions | [
"Gets",
"the",
"results",
"that",
"match",
"a",
"variable",
"number",
"of",
"passed",
"criterions",
".",
"Call",
"this",
"method",
"without",
"arguments",
"to",
"find",
"all",
"entities",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L261-L268 |
108,824 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.findByUniqueCriteria | @SuppressWarnings("unchecked")
public E findByUniqueCriteria(Criterion... criterion) throws HibernateException {
LOG.trace("Finding one unique " + entityClass.getSimpleName()
+ " based on " + criterion.length + " criteria");
Criteria criteria = createDistinctRootEntityCriteria(criterion... | java | @SuppressWarnings("unchecked")
public E findByUniqueCriteria(Criterion... criterion) throws HibernateException {
LOG.trace("Finding one unique " + entityClass.getSimpleName()
+ " based on " + criterion.length + " criteria");
Criteria criteria = createDistinctRootEntityCriteria(criterion... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"E",
"findByUniqueCriteria",
"(",
"Criterion",
"...",
"criterion",
")",
"throws",
"HibernateException",
"{",
"LOG",
".",
"trace",
"(",
"\"Finding one unique \"",
"+",
"entityClass",
".",
"getSimpleName",
... | Gets the unique result, that matches a variable number of passed
criterions.
@param criterion A variable number of hibernate criterions
@return Entity matching the passed hibernate criterions
@throws HibernateException if there is more than one matching result | [
"Gets",
"the",
"unique",
"result",
"that",
"matches",
"a",
"variable",
"number",
"of",
"passed",
"criterions",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L319-L326 |
108,825 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.findByCriteriaWithSortingAndPaging | @SuppressWarnings("unchecked")
public PagingResult<E> findByCriteriaWithSortingAndPaging(Integer firstResult,
Integer maxResults, List<Order> sorters, Criterion... criterion) throws HibernateException {
int nrOfSorters = sorters == null ? 0 : so... | java | @SuppressWarnings("unchecked")
public PagingResult<E> findByCriteriaWithSortingAndPaging(Integer firstResult,
Integer maxResults, List<Order> sorters, Criterion... criterion) throws HibernateException {
int nrOfSorters = sorters == null ? 0 : so... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"PagingResult",
"<",
"E",
">",
"findByCriteriaWithSortingAndPaging",
"(",
"Integer",
"firstResult",
",",
"Integer",
"maxResults",
",",
"List",
"<",
"Order",
">",
"sorters",
",",
"Criterion",
"...",
"cri... | Gets the results, that match a variable number of passed criterions,
considering the paging- and sort-info at the same time.
@param firstResult Starting index for the paging request.
@param maxResults Max number of result size.
@param criterion A variable number of hibernate criterions
@return | [
"Gets",
"the",
"results",
"that",
"match",
"a",
"variable",
"number",
"of",
"passed",
"criterions",
"considering",
"the",
"paging",
"-",
"and",
"sort",
"-",
"info",
"at",
"the",
"same",
"time",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L337-L368 |
108,826 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java | GenericHibernateDao.getTotalCount | public Number getTotalCount(Criterion... criterion) throws HibernateException {
Criteria criteria = getSession().createCriteria(entityClass);
addCriterionsToCriteria(criteria, criterion);
criteria.setProjection(Projections.rowCount());
return (Long) criteria.uniqueResult();
} | java | public Number getTotalCount(Criterion... criterion) throws HibernateException {
Criteria criteria = getSession().createCriteria(entityClass);
addCriterionsToCriteria(criteria, criterion);
criteria.setProjection(Projections.rowCount());
return (Long) criteria.uniqueResult();
} | [
"public",
"Number",
"getTotalCount",
"(",
"Criterion",
"...",
"criterion",
")",
"throws",
"HibernateException",
"{",
"Criteria",
"criteria",
"=",
"getSession",
"(",
")",
".",
"createCriteria",
"(",
"entityClass",
")",
";",
"addCriterionsToCriteria",
"(",
"criteria",... | Returns the total count of db entries for the current type.
@param criterion
@return | [
"Returns",
"the",
"total",
"count",
"of",
"db",
"entries",
"for",
"the",
"current",
"type",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/dao/GenericHibernateDao.java#L476-L481 |
108,827 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LdapService.java | LdapService.authenticate | public void authenticate(String username, String password) {
ldapTemplate.authenticate(query().where("objectClass").is("simpleSecurityObject").and("cn").is(username), password);
LOGGER.info("Successfully authenticated " + username);
} | java | public void authenticate(String username, String password) {
ldapTemplate.authenticate(query().where("objectClass").is("simpleSecurityObject").and("cn").is(username), password);
LOGGER.info("Successfully authenticated " + username);
} | [
"public",
"void",
"authenticate",
"(",
"String",
"username",
",",
"String",
"password",
")",
"{",
"ldapTemplate",
".",
"authenticate",
"(",
"query",
"(",
")",
".",
"where",
"(",
"\"objectClass\"",
")",
".",
"is",
"(",
"\"simpleSecurityObject\"",
")",
".",
"a... | Authenticate against ldap.
@param username the username
@param password the password | [
"Authenticate",
"against",
"ldap",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LdapService.java#L44-L47 |
108,828 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LdapService.java | LdapService.getGroups | public List<String> getGroups(String username, String property) {
final List<String> result = new ArrayList<>();
ldapTemplate.search(query().where("cn").is(username), new AttributesMapper<String>() {
public String mapFromAttributes(Attributes attrs) throws NamingException {
N... | java | public List<String> getGroups(String username, String property) {
final List<String> result = new ArrayList<>();
ldapTemplate.search(query().where("cn").is(username), new AttributesMapper<String>() {
public String mapFromAttributes(Attributes attrs) throws NamingException {
N... | [
"public",
"List",
"<",
"String",
">",
"getGroups",
"(",
"String",
"username",
",",
"String",
"property",
")",
"{",
"final",
"List",
"<",
"String",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"ldapTemplate",
".",
"search",
"(",
"query",
... | Extract groups from ldap.
@param username username to search for
@param property the property to extract the groups from
@return a list of group names from ldap | [
"Extract",
"groups",
"from",
"ldap",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/LdapService.java#L56-L71 |
108,829 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/mail/MailPublisher.java | MailPublisher.sendMail | public void sendMail(String from, String replyTo, String[] to, String[] cc,
String[] bcc, String subject, String msg) throws Exception {
SimpleMailMessage simpleMailMassage = new SimpleMailMessage();
// fallback to default mail sender
if (from == null || from.isEmpty()... | java | public void sendMail(String from, String replyTo, String[] to, String[] cc,
String[] bcc, String subject, String msg) throws Exception {
SimpleMailMessage simpleMailMassage = new SimpleMailMessage();
// fallback to default mail sender
if (from == null || from.isEmpty()... | [
"public",
"void",
"sendMail",
"(",
"String",
"from",
",",
"String",
"replyTo",
",",
"String",
"[",
"]",
"to",
",",
"String",
"[",
"]",
"cc",
",",
"String",
"[",
"]",
"bcc",
",",
"String",
"subject",
",",
"String",
"msg",
")",
"throws",
"Exception",
"... | Sends a SimpleMailMessage.
@param from The mail sender address.
@param replyTo The reply to address.
@param to A list of mail recipient addresses.
@param cc A list of carbon copy mail recipient addresses.
@param bcc A list of blind carbon copy mail recipient addresses.
@param subject The mail subject.... | [
"Sends",
"a",
"SimpleMailMessage",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/mail/MailPublisher.java#L56-L75 |
108,830 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/mail/MailPublisher.java | MailPublisher.sendMimeMail | public void sendMimeMail(String from, String replyTo, String[] to, String[] cc,
String[] bcc, String subject, String msg, Boolean html,
String attachmentFilename, File attachmentFile)
throws MessagingException, MailException {
Boolean multipart ... | java | public void sendMimeMail(String from, String replyTo, String[] to, String[] cc,
String[] bcc, String subject, String msg, Boolean html,
String attachmentFilename, File attachmentFile)
throws MessagingException, MailException {
Boolean multipart ... | [
"public",
"void",
"sendMimeMail",
"(",
"String",
"from",
",",
"String",
"replyTo",
",",
"String",
"[",
"]",
"to",
",",
"String",
"[",
"]",
"cc",
",",
"String",
"[",
"]",
"bcc",
",",
"String",
"subject",
",",
"String",
"msg",
",",
"Boolean",
"html",
"... | Sends a MimeMessage.
@param from The mail sender address.
@param replyTo The reply to address.
@param to A list of mail recipient addresses.
@param cc A list of carbon copy mail recipient addresses.
@param bcc A list of blind carbon copy mail reci... | [
"Sends",
"a",
"MimeMessage",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/mail/MailPublisher.java#L93-L141 |
108,831 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/ImplicitNamingStrategyShogunCore.java | ImplicitNamingStrategyShogunCore.transformEntityName | @Override
protected String transformEntityName(EntityNaming entityNaming) {
String singular = super.transformEntityName(entityNaming);
return transformToPluralForm(singular);
} | java | @Override
protected String transformEntityName(EntityNaming entityNaming) {
String singular = super.transformEntityName(entityNaming);
return transformToPluralForm(singular);
} | [
"@",
"Override",
"protected",
"String",
"transformEntityName",
"(",
"EntityNaming",
"entityNaming",
")",
"{",
"String",
"singular",
"=",
"super",
".",
"transformEntityName",
"(",
"entityNaming",
")",
";",
"return",
"transformToPluralForm",
"(",
"singular",
")",
";",... | Transforms an entity name to plural form. | [
"Transforms",
"an",
"entity",
"name",
"to",
"plural",
"form",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/ImplicitNamingStrategyShogunCore.java#L114-L120 |
108,832 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java | UserService.registerUser | public E registerUser(E user, HttpServletRequest request) throws Exception {
String email = user.getEmail();
// check if a user with the email already exists
E existingUser = dao.findByEmail(email);
if (existingUser != null) {
final String errorMessage = "User with eMail '... | java | public E registerUser(E user, HttpServletRequest request) throws Exception {
String email = user.getEmail();
// check if a user with the email already exists
E existingUser = dao.findByEmail(email);
if (existingUser != null) {
final String errorMessage = "User with eMail '... | [
"public",
"E",
"registerUser",
"(",
"E",
"user",
",",
"HttpServletRequest",
"request",
")",
"throws",
"Exception",
"{",
"String",
"email",
"=",
"user",
".",
"getEmail",
"(",
")",
";",
"// check if a user with the email already exists",
"E",
"existingUser",
"=",
"d... | Registers a new user. Initially, the user will be inactive. An email with
an activation link will be sent to the user.
@param user A user with an UNencrypted password (!)
@param request
@throws Exception | [
"Registers",
"a",
"new",
"user",
".",
"Initially",
"the",
"user",
"will",
"be",
"inactive",
".",
"An",
"email",
"with",
"an",
"activation",
"link",
"will",
"be",
"sent",
"to",
"the",
"user",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java#L122-L141 |
108,833 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java | UserService.persistNewUser | public E persistNewUser(E user, boolean encryptPassword) {
if (user.getId() != null) {
// to be sure that we are in the
// "create" case, the id must be null
return user;
}
if (encryptPassword) {
user.setPassword(passwordEncoder.encode(user.getPa... | java | public E persistNewUser(E user, boolean encryptPassword) {
if (user.getId() != null) {
// to be sure that we are in the
// "create" case, the id must be null
return user;
}
if (encryptPassword) {
user.setPassword(passwordEncoder.encode(user.getPa... | [
"public",
"E",
"persistNewUser",
"(",
"E",
"user",
",",
"boolean",
"encryptPassword",
")",
"{",
"if",
"(",
"user",
".",
"getId",
"(",
")",
"!=",
"null",
")",
"{",
"// to be sure that we are in the",
"// \"create\" case, the id must be null",
"return",
"user",
";",... | Persists a new user in the database.
@param user The user to create
@param encryptPassword Whether or not the current password of the user object should
be encrypted or not before the object is persisted in the db
@return The persisted user object (incl. ID value) | [
"Persists",
"a",
"new",
"user",
"in",
"the",
"database",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/UserService.java#L189-L204 |
108,834 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/PropertyValueConverter.java | PropertyValueConverter.convertToEntityAttribute | @Override
public Object convertToEntityAttribute(String dbData) {
if ("true".equalsIgnoreCase(dbData)) {
return true;
} else if ("false".equalsIgnoreCase(dbData)) {
return false;
} else if (NumberUtils.isParsable(dbData)) {
if (NumberUtils.isDigits(dbData)... | java | @Override
public Object convertToEntityAttribute(String dbData) {
if ("true".equalsIgnoreCase(dbData)) {
return true;
} else if ("false".equalsIgnoreCase(dbData)) {
return false;
} else if (NumberUtils.isParsable(dbData)) {
if (NumberUtils.isDigits(dbData)... | [
"@",
"Override",
"public",
"Object",
"convertToEntityAttribute",
"(",
"String",
"dbData",
")",
"{",
"if",
"(",
"\"true\"",
".",
"equalsIgnoreCase",
"(",
"dbData",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"\"false\"",
".",
"equalsIgnoreCa... | Converts a string value from the database to the best matching java
primitive type. | [
"Converts",
"a",
"string",
"value",
"from",
"the",
"database",
"to",
"the",
"best",
"matching",
"java",
"primitive",
"type",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/converter/PropertyValueConverter.java#L37-L53 |
108,835 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/UserGroupPermissionEvaluator.java | UserGroupPermissionEvaluator.hasPermission | @Override
public boolean hasPermission(User user, E userGroup, Permission permission) {
// always grant READ access to groups in which the user itself is a member
if (user != null && permission.equals(Permission.READ)
&& userGroup.getMembers().contains(user)) {
LOG.trace("Gr... | java | @Override
public boolean hasPermission(User user, E userGroup, Permission permission) {
// always grant READ access to groups in which the user itself is a member
if (user != null && permission.equals(Permission.READ)
&& userGroup.getMembers().contains(user)) {
LOG.trace("Gr... | [
"@",
"Override",
"public",
"boolean",
"hasPermission",
"(",
"User",
"user",
",",
"E",
"userGroup",
",",
"Permission",
"permission",
")",
"{",
"// always grant READ access to groups in which the user itself is a member",
"if",
"(",
"user",
"!=",
"null",
"&&",
"permission... | Grants READ permission on groups where the user is a member.
Uses default implementation otherwise. | [
"Grants",
"READ",
"permission",
"on",
"groups",
"where",
"the",
"user",
"is",
"a",
"member",
".",
"Uses",
"default",
"implementation",
"otherwise",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/security/access/entity/UserGroupPermissionEvaluator.java#L34-L46 |
108,836 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java | PhysicalNamingStrategyShogunCore.toPhysicalTableName | @Override
public Identifier toPhysicalTableName(Identifier tableIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix);
} | java | @Override
public Identifier toPhysicalTableName(Identifier tableIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, tableIdentifier, tablePrefix);
} | [
"@",
"Override",
"public",
"Identifier",
"toPhysicalTableName",
"(",
"Identifier",
"tableIdentifier",
",",
"JdbcEnvironment",
"context",
")",
"{",
"return",
"convertToLimitedLowerCase",
"(",
"context",
",",
"tableIdentifier",
",",
"tablePrefix",
")",
";",
"}"
] | Converts table names to lower case and limits the length if necessary. | [
"Converts",
"table",
"names",
"to",
"lower",
"case",
"and",
"limits",
"the",
"length",
"if",
"necessary",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L48-L51 |
108,837 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java | PhysicalNamingStrategyShogunCore.toPhysicalColumnName | @Override
public Identifier toPhysicalColumnName(Identifier columnIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, columnIdentifier, null);
} | java | @Override
public Identifier toPhysicalColumnName(Identifier columnIdentifier, JdbcEnvironment context) {
return convertToLimitedLowerCase(context, columnIdentifier, null);
} | [
"@",
"Override",
"public",
"Identifier",
"toPhysicalColumnName",
"(",
"Identifier",
"columnIdentifier",
",",
"JdbcEnvironment",
"context",
")",
"{",
"return",
"convertToLimitedLowerCase",
"(",
"context",
",",
"columnIdentifier",
",",
"null",
")",
";",
"}"
] | Converts column names to lower case and limits the length if necessary. | [
"Converts",
"column",
"names",
"to",
"lower",
"case",
"and",
"limits",
"the",
"length",
"if",
"necessary",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L56-L59 |
108,838 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java | PhysicalNamingStrategyShogunCore.getIdentifierLengthLimit | protected Integer getIdentifierLengthLimit(JdbcEnvironment context) {
// https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/package-summary.html
String dialectName = context.getDialect().getClass().getSimpleName();
if (dialectName.startsWith("Oracle")) {
// iden... | java | protected Integer getIdentifierLengthLimit(JdbcEnvironment context) {
// https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/package-summary.html
String dialectName = context.getDialect().getClass().getSimpleName();
if (dialectName.startsWith("Oracle")) {
// iden... | [
"protected",
"Integer",
"getIdentifierLengthLimit",
"(",
"JdbcEnvironment",
"context",
")",
"{",
"// https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/dialect/package-summary.html",
"String",
"dialectName",
"=",
"context",
".",
"getDialect",
"(",
")",
".",
"getClass... | Determines the identifier length limit for the given JDBC context.
Returns null if no limitation is necessary.
@param context The current JDBC context
@return The identifier length limit for the given context. null
otherwise. | [
"Determines",
"the",
"identifier",
"length",
"limit",
"for",
"the",
"given",
"JDBC",
"context",
".",
"Returns",
"null",
"if",
"no",
"limitation",
"is",
"necessary",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/naming/PhysicalNamingStrategyShogunCore.java#L101-L120 |
108,839 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/MutableHttpServletRequest.java | MutableHttpServletRequest.getParameterIgnoreCase | public String getParameterIgnoreCase(String name) {
for (Map.Entry<String, String[]> entry : customParameters.entrySet()) {
if (entry.getKey().equalsIgnoreCase(name)) {
return StringUtils.join(entry.getValue(), ",");
}
}
return null;
} | java | public String getParameterIgnoreCase(String name) {
for (Map.Entry<String, String[]> entry : customParameters.entrySet()) {
if (entry.getKey().equalsIgnoreCase(name)) {
return StringUtils.join(entry.getValue(), ",");
}
}
return null;
} | [
"public",
"String",
"getParameterIgnoreCase",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"String",
"[",
"]",
">",
"entry",
":",
"customParameters",
".",
"entrySet",
"(",
")",
")",
"{",
"if",
"(",
"entry",
".",... | Get a parameter by name, ignoring case.
@param name the parameter to get
@return a comma separated list of parameter values | [
"Get",
"a",
"parameter",
"by",
"name",
"ignoring",
"case",
"."
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/util/interceptor/MutableHttpServletRequest.java#L358-L365 |
108,840 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/init/ContentInitializer.java | ContentInitializer.initializeDatabaseContent | public void initializeDatabaseContent() {
if (this.shogunInitEnabled) {
LOG.info("Initializing SHOGun content");
for (PersistentObject object : objectsToCreate) {
if (object instanceof User) {
// special handling of users to encrypt the password!
... | java | public void initializeDatabaseContent() {
if (this.shogunInitEnabled) {
LOG.info("Initializing SHOGun content");
for (PersistentObject object : objectsToCreate) {
if (object instanceof User) {
// special handling of users to encrypt the password!
... | [
"public",
"void",
"initializeDatabaseContent",
"(",
")",
"{",
"if",
"(",
"this",
".",
"shogunInitEnabled",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Initializing SHOGun content\"",
")",
";",
"for",
"(",
"PersistentObject",
"object",
":",
"objectsToCreate",
")",
"{",... | The method called on initialization | [
"The",
"method",
"called",
"on",
"initialization"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/init/ContentInitializer.java#L56-L70 |
108,841 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/FileService.java | FileService.uploadFile | @PreAuthorize("isAuthenticated()")
public E uploadFile(MultipartFile file) throws Exception {
if (file == null) {
final String errMsg = "Upload failed. File is null.";
LOG.error(errMsg);
throw new Exception(errMsg);
} else if (file.isEmpty()) {
final ... | java | @PreAuthorize("isAuthenticated()")
public E uploadFile(MultipartFile file) throws Exception {
if (file == null) {
final String errMsg = "Upload failed. File is null.";
LOG.error(errMsg);
throw new Exception(errMsg);
} else if (file.isEmpty()) {
final ... | [
"@",
"PreAuthorize",
"(",
"\"isAuthenticated()\"",
")",
"public",
"E",
"uploadFile",
"(",
"MultipartFile",
"file",
")",
"throws",
"Exception",
"{",
"if",
"(",
"file",
"==",
"null",
")",
"{",
"final",
"String",
"errMsg",
"=",
"\"Upload failed. File is null.\"",
"... | Method persists a given MultipartFile as a bytearray in the database
@param file
@throws Exception | [
"Method",
"persists",
"a",
"given",
"MultipartFile",
"as",
"a",
"bytearray",
"in",
"the",
"database"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/FileService.java#L59-L92 |
108,842 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ImageFileService.java | ImageFileService.saveImage | @PreAuthorize("isAuthenticated()")
public E saveImage(MultipartFile file, boolean createThumbnail, Integer thumbnailTargetSize)
throws Exception {
InputStream is = null;
ByteArrayInputStream bais = null;
E imageToPersist = null;
try {
is = file.getInputStream();... | java | @PreAuthorize("isAuthenticated()")
public E saveImage(MultipartFile file, boolean createThumbnail, Integer thumbnailTargetSize)
throws Exception {
InputStream is = null;
ByteArrayInputStream bais = null;
E imageToPersist = null;
try {
is = file.getInputStream();... | [
"@",
"PreAuthorize",
"(",
"\"isAuthenticated()\"",
")",
"public",
"E",
"saveImage",
"(",
"MultipartFile",
"file",
",",
"boolean",
"createThumbnail",
",",
"Integer",
"thumbnailTargetSize",
")",
"throws",
"Exception",
"{",
"InputStream",
"is",
"=",
"null",
";",
"Byt... | Method persists a given Image as a bytearray in the database
@param file
@param createThumbnail
@param thumbnailTargetSize
@throws Exception | [
"Method",
"persists",
"a",
"given",
"Image",
"as",
"a",
"bytearray",
"in",
"the",
"database"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ImageFileService.java#L98-L148 |
108,843 | terrestris/shogun-core | src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ImageFileService.java | ImageFileService.scaleImage | public static byte[] scaleImage(byte[] imageBytes, String outputFormat,
Integer targetSize) throws Exception {
InputStream is = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] imageInBytes = null;
BufferedImage image = null;
... | java | public static byte[] scaleImage(byte[] imageBytes, String outputFormat,
Integer targetSize) throws Exception {
InputStream is = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] imageInBytes = null;
BufferedImage image = null;
... | [
"public",
"static",
"byte",
"[",
"]",
"scaleImage",
"(",
"byte",
"[",
"]",
"imageBytes",
",",
"String",
"outputFormat",
",",
"Integer",
"targetSize",
")",
"throws",
"Exception",
"{",
"InputStream",
"is",
"=",
"null",
";",
"ByteArrayOutputStream",
"baos",
"=",
... | Scales an image by the given dimensions
@param outputFormat
@param targetSize width/height in px (square)
@throws Exception | [
"Scales",
"an",
"image",
"by",
"the",
"given",
"dimensions"
] | 3dbabda35ae63235265913c865dba389b050b6e6 | https://github.com/terrestris/shogun-core/blob/3dbabda35ae63235265913c865dba389b050b6e6/src/shogun-core-main/src/main/java/de/terrestris/shoguncore/service/ImageFileService.java#L157-L185 |
108,844 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/JenkinsLogs.java | JenkinsLogs.addMasterJulLogRecords | private void addMasterJulLogRecords(Container result) {
// this file captures the most recent of those that are still kept around in memory.
// this overlaps with Jenkins.logRecords, and also overlaps with what's written in files,
// but added nonetheless just in case.
//
// shou... | java | private void addMasterJulLogRecords(Container result) {
// this file captures the most recent of those that are still kept around in memory.
// this overlaps with Jenkins.logRecords, and also overlaps with what's written in files,
// but added nonetheless just in case.
//
// shou... | [
"private",
"void",
"addMasterJulLogRecords",
"(",
"Container",
"result",
")",
"{",
"// this file captures the most recent of those that are still kept around in memory.",
"// this overlaps with Jenkins.logRecords, and also overlaps with what's written in files,",
"// but added nonetheless just i... | Adds j.u.l logging output that the support-core plugin captures.
<p>
Compared to {@link #addMasterJulRingBuffer(Container)}, this one uses disk files,
so it remembers larger number of entries. | [
"Adds",
"j",
".",
"u",
".",
"l",
"logging",
"output",
"that",
"the",
"support",
"-",
"core",
"plugin",
"captures",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/JenkinsLogs.java#L172-L195 |
108,845 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/LoadStats.java | LoadStats.camelCaseToSentenceCase | private static String camelCaseToSentenceCase(String camelCase) {
String name = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(camelCase), " ");
return name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1)
.toLowerCase(Locale.ENGLISH);
} | java | private static String camelCaseToSentenceCase(String camelCase) {
String name = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(camelCase), " ");
return name.substring(0, 1).toUpperCase(Locale.ENGLISH) + name.substring(1)
.toLowerCase(Locale.ENGLISH);
} | [
"private",
"static",
"String",
"camelCaseToSentenceCase",
"(",
"String",
"camelCase",
")",
"{",
"String",
"name",
"=",
"StringUtils",
".",
"join",
"(",
"StringUtils",
".",
"splitByCharacterTypeCamelCase",
"(",
"camelCase",
")",
",",
"\" \"",
")",
";",
"return",
... | Converts "aCamelCaseString" into "A sentence case string".
@param camelCase camelCase.
@return Sentence case. | [
"Converts",
"aCamelCaseString",
"into",
"A",
"sentence",
"case",
"string",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/LoadStats.java#L295-L299 |
108,846 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java | ContentMappings.newInstance | public static @Extension ContentMappings newInstance() throws IOException {
ContentMappings mappings = Persistence.load(ContentMappings.class);
if (mappings == null) {
mappings = (ContentMappings) new XmlProxy().readResolve();
}
return mappings;
} | java | public static @Extension ContentMappings newInstance() throws IOException {
ContentMappings mappings = Persistence.load(ContentMappings.class);
if (mappings == null) {
mappings = (ContentMappings) new XmlProxy().readResolve();
}
return mappings;
} | [
"public",
"static",
"@",
"Extension",
"ContentMappings",
"newInstance",
"(",
")",
"throws",
"IOException",
"{",
"ContentMappings",
"mappings",
"=",
"Persistence",
".",
"load",
"(",
"ContentMappings",
".",
"class",
")",
";",
"if",
"(",
"mappings",
"==",
"null",
... | Constructs a new ContentMappings using an existing config file or default settings if not found. | [
"Constructs",
"a",
"new",
"ContentMappings",
"using",
"an",
"existing",
"config",
"file",
"or",
"default",
"settings",
"if",
"not",
"found",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java#L74-L80 |
108,847 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/SupportAction.java | SupportAction.doDownload | @RequirePOST
public void doDownload(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
doGenerateAllBundles(req, rsp);
} | java | @RequirePOST
public void doDownload(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException {
doGenerateAllBundles(req, rsp);
} | [
"@",
"RequirePOST",
"public",
"void",
"doDownload",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"doGenerateAllBundles",
"(",
"req",
",",
"rsp",
")",
";",
"}"
] | Generates a support bundle.
@param req The stapler request
@param rsp The stapler response
@throws ServletException
@throws IOException | [
"Generates",
"a",
"support",
"bundle",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/SupportAction.java#L165-L168 |
108,848 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/api/FileContent.java | FileContent.isBinary | private boolean isBinary() {
try (InputStream in = getInputStream()) {
long size = Files.size(file.toPath());
if (size == 0) {
// Empty file, so no need to check
return true;
}
byte[] b = new byte[( size < StreamUtils.DEFAULT_PROBE... | java | private boolean isBinary() {
try (InputStream in = getInputStream()) {
long size = Files.size(file.toPath());
if (size == 0) {
// Empty file, so no need to check
return true;
}
byte[] b = new byte[( size < StreamUtils.DEFAULT_PROBE... | [
"private",
"boolean",
"isBinary",
"(",
")",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"getInputStream",
"(",
")",
")",
"{",
"long",
"size",
"=",
"Files",
".",
"size",
"(",
"file",
".",
"toPath",
"(",
")",
")",
";",
"if",
"(",
"size",
"==",
"0",
... | Check if the file is binary or not | [
"Check",
"if",
"the",
"file",
"is",
"binary",
"or",
"not"
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/api/FileContent.java#L169-L190 |
108,849 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getVersion | private static String getVersion() {
Properties properties = new Properties();
try (InputStream ins = HttpRosetteAPI.class.getClassLoader().getResourceAsStream("version.properties")) {
properties.load(ins);
} catch (IOException e) {
// should not happen
}
... | java | private static String getVersion() {
Properties properties = new Properties();
try (InputStream ins = HttpRosetteAPI.class.getClassLoader().getResourceAsStream("version.properties")) {
properties.load(ins);
} catch (IOException e) {
// should not happen
}
... | [
"private",
"static",
"String",
"getVersion",
"(",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"(",
"InputStream",
"ins",
"=",
"HttpRosetteAPI",
".",
"class",
".",
"getClassLoader",
"(",
")",
".",
"getResourceAsStream",... | Returns the version of the binding.
@return version of the binding | [
"Returns",
"the",
"version",
"of",
"the",
"binding",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L144-L152 |
108,850 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getBytes | private static byte[] getBytes(InputStream is) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[4096];
while (true) {
int r = is.read(buf);
if (r == -1) {
out.flush();
return out.toByteAr... | java | private static byte[] getBytes(InputStream is) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[4096];
while (true) {
int r = is.read(buf);
if (r == -1) {
out.flush();
return out.toByteAr... | [
"private",
"static",
"byte",
"[",
"]",
"getBytes",
"(",
"InputStream",
"is",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"4096",
"]... | Returns a byte array from InputStream.
@param is InputStream
@return byte array
@throws IOException | [
"Returns",
"a",
"byte",
"array",
"from",
"InputStream",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L161-L174 |
108,851 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getSupportedLanguages | @Override
public SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws HttpRosetteAPIException {
if (DOC_ENDPOINTS.contains(endpoint) || NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, SupportedLangua... | java | @Override
public SupportedLanguagesResponse getSupportedLanguages(String endpoint) throws HttpRosetteAPIException {
if (DOC_ENDPOINTS.contains(endpoint) || NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, SupportedLangua... | [
"@",
"Override",
"public",
"SupportedLanguagesResponse",
"getSupportedLanguages",
"(",
"String",
"endpoint",
")",
"throws",
"HttpRosetteAPIException",
"{",
"if",
"(",
"DOC_ENDPOINTS",
".",
"contains",
"(",
"endpoint",
")",
"||",
"NAME_DEDUPLICATION_SERVICE_PATH",
".",
"... | Gets the set of language and script codes supported by the specified Rosette API endpoint.
@return SupportedLanguagesResponse
@throws HttpRosetteAPIException for an error returned from the Rosette API. | [
"Gets",
"the",
"set",
"of",
"language",
"and",
"script",
"codes",
"supported",
"by",
"the",
"specified",
"Rosette",
"API",
"endpoint",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L240-L247 |
108,852 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getSupportedLanguagePairs | @Override
public SupportedLanguagePairsResponse getSupportedLanguagePairs(String endpoint) throws HttpRosetteAPIException {
if (NAMES_ENDPOINTS.contains(endpoint) && !NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, Supp... | java | @Override
public SupportedLanguagePairsResponse getSupportedLanguagePairs(String endpoint) throws HttpRosetteAPIException {
if (NAMES_ENDPOINTS.contains(endpoint) && !NAME_DEDUPLICATION_SERVICE_PATH.equals(endpoint)) {
return sendGetRequest(urlBase + endpoint + SUPPORTED_LANGUAGES_SUBPATH, Supp... | [
"@",
"Override",
"public",
"SupportedLanguagePairsResponse",
"getSupportedLanguagePairs",
"(",
"String",
"endpoint",
")",
"throws",
"HttpRosetteAPIException",
"{",
"if",
"(",
"NAMES_ENDPOINTS",
".",
"contains",
"(",
"endpoint",
")",
"&&",
"!",
"NAME_DEDUPLICATION_SERVICE_... | Gets the set of language, script codes and transliteration scheme pairs supported by the specified Rosette API
endpoint.
@param endpoint Rosette API endpoint.
@return SupportedLanguagePairsResponse
@throws HttpRosetteAPIException for an error returned from the Rosette API. | [
"Gets",
"the",
"set",
"of",
"language",
"script",
"codes",
"and",
"transliteration",
"scheme",
"pairs",
"supported",
"by",
"the",
"specified",
"Rosette",
"API",
"endpoint",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L257-L264 |
108,853 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.performAsync | @Override
public <RequestType extends Request, ResponseType extends Response> Future<ResponseType> performAsync(String endpoint, RequestType request, Class<ResponseType> responseClass) throws HttpRosetteAPIException {
throw new UnsupportedOperationException("Asynchronous operations are not yet supported");
... | java | @Override
public <RequestType extends Request, ResponseType extends Response> Future<ResponseType> performAsync(String endpoint, RequestType request, Class<ResponseType> responseClass) throws HttpRosetteAPIException {
throw new UnsupportedOperationException("Asynchronous operations are not yet supported");
... | [
"@",
"Override",
"public",
"<",
"RequestType",
"extends",
"Request",
",",
"ResponseType",
"extends",
"Response",
">",
"Future",
"<",
"ResponseType",
">",
"performAsync",
"(",
"String",
"endpoint",
",",
"RequestType",
"request",
",",
"Class",
"<",
"ResponseType",
... | This method always throws UnsupportedOperationException. | [
"This",
"method",
"always",
"throws",
"UnsupportedOperationException",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L311-L314 |
108,854 | rosette-api/java | api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java | HttpRosetteAPI.getResponse | private <T extends Object> T getResponse(HttpResponse httpResponse, Class<T> clazz) throws IOException, HttpRosetteAPIException {
int status = httpResponse.getStatusLine().getStatusCode();
String encoding = headerValueOrNull(httpResponse.getFirstHeader(HttpHeaders.CONTENT_ENCODING));
try (
... | java | private <T extends Object> T getResponse(HttpResponse httpResponse, Class<T> clazz) throws IOException, HttpRosetteAPIException {
int status = httpResponse.getStatusLine().getStatusCode();
String encoding = headerValueOrNull(httpResponse.getFirstHeader(HttpHeaders.CONTENT_ENCODING));
try (
... | [
"private",
"<",
"T",
"extends",
"Object",
">",
"T",
"getResponse",
"(",
"HttpResponse",
"httpResponse",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IOException",
",",
"HttpRosetteAPIException",
"{",
"int",
"status",
"=",
"httpResponse",
".",
"getStat... | Gets response from HTTP connection, according to the specified response class;
throws for an error response.
@param httpResponse the response object
@param clazz Response class
@return Response
@throws IOException | [
"Gets",
"response",
"from",
"HTTP",
"connection",
"according",
"to",
"the",
"specified",
"response",
"class",
";",
"throws",
"for",
"an",
"error",
"response",
"."
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/api/src/main/java/com/basistech/rosette/api/HttpRosetteAPI.java#L535-L585 |
108,855 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java | SecretHandler.findSecrets | public static String findSecrets(File xmlFile) throws SAXException, IOException, TransformerException {
XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) {
private String tagName = "";
@Override
public void startElement(String uri, String localName, Strin... | java | public static String findSecrets(File xmlFile) throws SAXException, IOException, TransformerException {
XMLReader xr = new XMLFilterImpl(XMLReaderFactory.createXMLReader()) {
private String tagName = "";
@Override
public void startElement(String uri, String localName, Strin... | [
"public",
"static",
"String",
"findSecrets",
"(",
"File",
"xmlFile",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"TransformerException",
"{",
"XMLReader",
"xr",
"=",
"new",
"XMLFilterImpl",
"(",
"XMLReaderFactory",
".",
"createXMLReader",
"(",
")",
")"... | find the secret in the xml file and replace it with the place holder
@param xmlFile we want to parse
@return the patched xml content with redacted secrets
@throws SAXException if some XML parsing issue occurs.
@throws IOException if some issue occurs while reading the providing file.
@throws TransformerException if an ... | [
"find",
"the",
"secret",
"in",
"the",
"xml",
"file",
"and",
"replace",
"it",
"with",
"the",
"place",
"holder"
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java#L62-L117 |
108,856 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java | SecretHandler.createSafeSource | private static Source createSafeSource(XMLReader reader, InputSource source) {
try {
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (SAXException ignored) {
/* Fallback entity resolver will be used */
}
try {
... | java | private static Source createSafeSource(XMLReader reader, InputSource source) {
try {
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (SAXException ignored) {
/* Fallback entity resolver will be used */
}
try {
... | [
"private",
"static",
"Source",
"createSafeSource",
"(",
"XMLReader",
"reader",
",",
"InputSource",
"source",
")",
"{",
"try",
"{",
"reader",
".",
"setFeature",
"(",
"\"http://xml.org/sax/features/external-general-entities\"",
",",
"false",
")",
";",
"}",
"catch",
"(... | Converts a Source into a Source that is protected against XXE attacks.
@see jenkins.util.xml.XMLUtils#safeTransform | [
"Converts",
"a",
"Source",
"into",
"a",
"Source",
"that",
"is",
"protected",
"against",
"XXE",
"attacks",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/configfiles/SecretHandler.java#L138-L154 |
108,857 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/FileDescriptorLimit.java | FileDescriptorLimit.getUlimit | @edu.umd.cs.findbugs.annotations.SuppressWarnings({"DM_DEFAULT_ENCODING", "OS_OPEN_STREAM"})
private static void getUlimit(PrintWriter writer) throws IOException {
// TODO should first check whether /bin/bash even exists
InputStream is = new ProcessBuilder("bash", "-c", "ulimit -a").start().getInput... | java | @edu.umd.cs.findbugs.annotations.SuppressWarnings({"DM_DEFAULT_ENCODING", "OS_OPEN_STREAM"})
private static void getUlimit(PrintWriter writer) throws IOException {
// TODO should first check whether /bin/bash even exists
InputStream is = new ProcessBuilder("bash", "-c", "ulimit -a").start().getInput... | [
"@",
"edu",
".",
"umd",
".",
"cs",
".",
"findbugs",
".",
"annotations",
".",
"SuppressWarnings",
"(",
"{",
"\"DM_DEFAULT_ENCODING\"",
",",
"\"OS_OPEN_STREAM\"",
"}",
")",
"private",
"static",
"void",
"getUlimit",
"(",
"PrintWriter",
"writer",
")",
"throws",
"I... | This method executes the command "bash -c ulimit -a" on the machine. | [
"This",
"method",
"executes",
"the",
"command",
"bash",
"-",
"c",
"ulimit",
"-",
"a",
"on",
"the",
"machine",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/FileDescriptorLimit.java#L188-L202 |
108,858 | rosette-api/java | model/src/main/java/com/basistech/rosette/apimodel/Response.java | Response.addExtendedInformation | public void addExtendedInformation(String key, Object value) {
if (extendedInformation == null) {
extendedInformation = new HashMap<>();
}
extendedInformation.put(key, value);
} | java | public void addExtendedInformation(String key, Object value) {
if (extendedInformation == null) {
extendedInformation = new HashMap<>();
}
extendedInformation.put(key, value);
} | [
"public",
"void",
"addExtendedInformation",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"extendedInformation",
"==",
"null",
")",
"{",
"extendedInformation",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"}",
"extendedInformation",
".",
... | add more extended information to the response
@param key
@param value | [
"add",
"more",
"extended",
"information",
"to",
"the",
"response"
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/model/src/main/java/com/basistech/rosette/apimodel/Response.java#L40-L45 |
108,859 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/FilteredOutputStream.java | FilteredOutputStream.flush | @Override
public synchronized void flush() throws IOException {
ensureOpen();
if (decodedBuf.position() > 0) {
decodedBuf.flip();
String contents = decodedBuf.toString();
String filtered = contentFilter.filter(contents);
out.write(filtered.getBytes(cha... | java | @Override
public synchronized void flush() throws IOException {
ensureOpen();
if (decodedBuf.position() > 0) {
decodedBuf.flip();
String contents = decodedBuf.toString();
String filtered = contentFilter.filter(contents);
out.write(filtered.getBytes(cha... | [
"@",
"Override",
"public",
"synchronized",
"void",
"flush",
"(",
")",
"throws",
"IOException",
"{",
"ensureOpen",
"(",
")",
";",
"if",
"(",
"decodedBuf",
".",
"position",
"(",
")",
">",
"0",
")",
"{",
"decodedBuf",
".",
"flip",
"(",
")",
";",
"String",... | Flushes the current buffered contents and filters them as is. | [
"Flushes",
"the",
"current",
"buffered",
"contents",
"and",
"filters",
"them",
"as",
"is",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/FilteredOutputStream.java#L131-L142 |
108,860 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/FilteredOutputStream.java | FilteredOutputStream.reset | public synchronized void reset() {
ensureOpen();
encodedBuf.clear();
if (decodedBuf.capacity() > FilteredConstants.DEFAULT_DECODER_CAPACITY) {
this.decodedBuf = CharBuffer.allocate(FilteredConstants.DEFAULT_DECODER_CAPACITY);
} else {
decodedBuf.clear();
}... | java | public synchronized void reset() {
ensureOpen();
encodedBuf.clear();
if (decodedBuf.capacity() > FilteredConstants.DEFAULT_DECODER_CAPACITY) {
this.decodedBuf = CharBuffer.allocate(FilteredConstants.DEFAULT_DECODER_CAPACITY);
} else {
decodedBuf.clear();
}... | [
"public",
"synchronized",
"void",
"reset",
"(",
")",
"{",
"ensureOpen",
"(",
")",
";",
"encodedBuf",
".",
"clear",
"(",
")",
";",
"if",
"(",
"decodedBuf",
".",
"capacity",
"(",
")",
">",
"FilteredConstants",
".",
"DEFAULT_DECODER_CAPACITY",
")",
"{",
"this... | Resets the state of this stream's decoders and buffers. | [
"Resets",
"the",
"state",
"of",
"this",
"stream",
"s",
"decoders",
"and",
"buffers",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/FilteredOutputStream.java#L199-L208 |
108,861 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/SlaveLogs.java | SlaveLogs.getActiveCacheKeys | private Set<String> getActiveCacheKeys(final List<Node> nodes) {
Set<String> cacheKeys = new HashSet<>(nodes.size());
for (Node node : nodes) {
// can't use node.getRootPath() cause won't work with disconnected agents.
String cacheKey = Util.getDigestOf(node.getNodeName() + ":" +... | java | private Set<String> getActiveCacheKeys(final List<Node> nodes) {
Set<String> cacheKeys = new HashSet<>(nodes.size());
for (Node node : nodes) {
// can't use node.getRootPath() cause won't work with disconnected agents.
String cacheKey = Util.getDigestOf(node.getNodeName() + ":" +... | [
"private",
"Set",
"<",
"String",
">",
"getActiveCacheKeys",
"(",
"final",
"List",
"<",
"Node",
">",
"nodes",
")",
"{",
"Set",
"<",
"String",
">",
"cacheKeys",
"=",
"new",
"HashSet",
"<>",
"(",
"nodes",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"... | Build a Set including the cacheKeys associated to every agent in the instance | [
"Build",
"a",
"Set",
"including",
"the",
"cacheKeys",
"associated",
"to",
"every",
"agent",
"in",
"the",
"instance"
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/SlaveLogs.java#L234-L243 |
108,862 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java | AboutJenkins.mayBeDate | static boolean mayBeDate(String s) {
if (s == null || s.length() != "yyyy-MM-dd_HH-mm-ss".length()) {
return false;
}
for (int i = 0; i < s.length(); i++) {
switch (s.charAt(i)) {
case '-':
switch (i) {
case 4:
... | java | static boolean mayBeDate(String s) {
if (s == null || s.length() != "yyyy-MM-dd_HH-mm-ss".length()) {
return false;
}
for (int i = 0; i < s.length(); i++) {
switch (s.charAt(i)) {
case '-':
switch (i) {
case 4:
... | [
"static",
"boolean",
"mayBeDate",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"length",
"(",
")",
"!=",
"\"yyyy-MM-dd_HH-mm-ss\"",
".",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i... | A pre-check to see if a string is a build timestamp formatted date.
@param s the string.
@return {@code true} if it is likely that the string will parse as a build timestamp formatted date. | [
"A",
"pre",
"-",
"check",
"to",
"see",
"if",
"a",
"string",
"is",
"a",
"build",
"timestamp",
"formatted",
"date",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java#L141-L247 |
108,863 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java | AboutJenkins.getPluginsSorted | private static Iterable<PluginWrapper> getPluginsSorted() {
PluginManager pluginManager = Jenkins.getInstance().getPluginManager();
return getPluginsSorted(pluginManager);
} | java | private static Iterable<PluginWrapper> getPluginsSorted() {
PluginManager pluginManager = Jenkins.getInstance().getPluginManager();
return getPluginsSorted(pluginManager);
} | [
"private",
"static",
"Iterable",
"<",
"PluginWrapper",
">",
"getPluginsSorted",
"(",
")",
"{",
"PluginManager",
"pluginManager",
"=",
"Jenkins",
".",
"getInstance",
"(",
")",
".",
"getPluginManager",
"(",
")",
";",
"return",
"getPluginsSorted",
"(",
"pluginManager... | Fixes JENKINS-47779 caused by JENKINS-47713
Not using SortedSet because of PluginWrapper doesn't implements equals and hashCode.
@return new copy of the PluginManager.getPlugins sorted | [
"Fixes",
"JENKINS",
"-",
"47779",
"caused",
"by",
"JENKINS",
"-",
"47713",
"Not",
"using",
"SortedSet",
"because",
"of",
"PluginWrapper",
"doesn",
"t",
"implements",
"equals",
"and",
"hashCode",
"."
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/impl/AboutJenkins.java#L876-L879 |
108,864 | rosette-api/java | examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java | ExampleBase.showUsage | protected static void showUsage(Class<? extends ExampleBase> commandClass) {
System.err.println(USAGE_STR + commandClass.getName());
} | java | protected static void showUsage(Class<? extends ExampleBase> commandClass) {
System.err.println(USAGE_STR + commandClass.getName());
} | [
"protected",
"static",
"void",
"showUsage",
"(",
"Class",
"<",
"?",
"extends",
"ExampleBase",
">",
"commandClass",
")",
"{",
"System",
".",
"err",
".",
"println",
"(",
"USAGE_STR",
"+",
"commandClass",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Prints out how to run the program
@param commandClass the class to use in the usage message. | [
"Prints",
"out",
"how",
"to",
"run",
"the",
"program"
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java#L61-L63 |
108,865 | rosette-api/java | examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java | ExampleBase.responseToJson | protected static String responseToJson(Response response) throws JsonProcessingException {
ObjectMapper mapper = ApiModelMixinModule.setupObjectMapper(new ObjectMapper());
mapper.enable(SerializationFeature.INDENT_OUTPUT);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
r... | java | protected static String responseToJson(Response response) throws JsonProcessingException {
ObjectMapper mapper = ApiModelMixinModule.setupObjectMapper(new ObjectMapper());
mapper.enable(SerializationFeature.INDENT_OUTPUT);
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
r... | [
"protected",
"static",
"String",
"responseToJson",
"(",
"Response",
"response",
")",
"throws",
"JsonProcessingException",
"{",
"ObjectMapper",
"mapper",
"=",
"ApiModelMixinModule",
".",
"setupObjectMapper",
"(",
"new",
"ObjectMapper",
"(",
")",
")",
";",
"mapper",
"... | Converts a response to JSON string
@param response {@link com.basistech.rosette.apimodel.Response Response} from RosetteAPI
@return the json string.
@throws JsonProcessingException if the Jackson library throws an error serializing. | [
"Converts",
"a",
"response",
"to",
"JSON",
"string"
] | 35faf9fbb9c940eae47df004da7639a3b177b80b | https://github.com/rosette-api/java/blob/35faf9fbb9c940eae47df004da7639a3b177b80b/examples/src/main/java/com/basistech/rosette/examples/ExampleBase.java#L72-L77 |
108,866 | jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java | WordReplacer.replaceWords | private static void replaceWords(StringBuilder input, String[] words, String[] replaces, boolean ignoreCase) {
if (input == null || input.length()==0 || words == null ||
words.length == 0 || replaces == null || replaces.length == 0) {
return;
}
// the same number of ... | java | private static void replaceWords(StringBuilder input, String[] words, String[] replaces, boolean ignoreCase) {
if (input == null || input.length()==0 || words == null ||
words.length == 0 || replaces == null || replaces.length == 0) {
return;
}
// the same number of ... | [
"private",
"static",
"void",
"replaceWords",
"(",
"StringBuilder",
"input",
",",
"String",
"[",
"]",
"words",
",",
"String",
"[",
"]",
"replaces",
",",
"boolean",
"ignoreCase",
")",
"{",
"if",
"(",
"input",
"==",
"null",
"||",
"input",
".",
"length",
"("... | To avoid repeat this code above | [
"To",
"avoid",
"repeat",
"this",
"code",
"above"
] | bcbe1dfd5bf48ac89903645cd48ed897c1a04688 | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/util/WordReplacer.java#L55-L69 |
108,867 | spring-projects/spring-credhub | spring-credhub-cloud-connector/src/main/java/org/springframework/credhub/cloud/CredHubInterpolationServiceDataPostProcessor.java | CredHubInterpolationServiceDataPostProcessor.connectorsToCredHub | private ServicesData connectorsToCredHub(CloudFoundryRawServiceData rawServiceData) {
ServicesData servicesData = new ServicesData();
servicesData.putAll(rawServiceData);
return servicesData;
} | java | private ServicesData connectorsToCredHub(CloudFoundryRawServiceData rawServiceData) {
ServicesData servicesData = new ServicesData();
servicesData.putAll(rawServiceData);
return servicesData;
} | [
"private",
"ServicesData",
"connectorsToCredHub",
"(",
"CloudFoundryRawServiceData",
"rawServiceData",
")",
"{",
"ServicesData",
"servicesData",
"=",
"new",
"ServicesData",
"(",
")",
";",
"servicesData",
".",
"putAll",
"(",
"rawServiceData",
")",
";",
"return",
"servi... | Convert from the Spring Cloud Connectors service data structure to the Spring
Credhub data structure.
@param rawServiceData the Spring Cloud Connectors data structure
@return the equivalent Spring CredHub data structure | [
"Convert",
"from",
"the",
"Spring",
"Cloud",
"Connectors",
"service",
"data",
"structure",
"to",
"the",
"Spring",
"Credhub",
"data",
"structure",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-cloud-connector/src/main/java/org/springframework/credhub/cloud/CredHubInterpolationServiceDataPostProcessor.java#L117-L121 |
108,868 | spring-projects/spring-credhub | spring-credhub-cloud-connector/src/main/java/org/springframework/credhub/cloud/CredHubInterpolationServiceDataPostProcessor.java | CredHubInterpolationServiceDataPostProcessor.credHubToConnectors | private CloudFoundryRawServiceData credHubToConnectors(
ServicesData interpolatedData) {
CloudFoundryRawServiceData rawServicesData = new CloudFoundryRawServiceData();
rawServicesData.putAll(interpolatedData);
return rawServicesData;
} | java | private CloudFoundryRawServiceData credHubToConnectors(
ServicesData interpolatedData) {
CloudFoundryRawServiceData rawServicesData = new CloudFoundryRawServiceData();
rawServicesData.putAll(interpolatedData);
return rawServicesData;
} | [
"private",
"CloudFoundryRawServiceData",
"credHubToConnectors",
"(",
"ServicesData",
"interpolatedData",
")",
"{",
"CloudFoundryRawServiceData",
"rawServicesData",
"=",
"new",
"CloudFoundryRawServiceData",
"(",
")",
";",
"rawServicesData",
".",
"putAll",
"(",
"interpolatedDat... | Convert from the Spring Credhub service data structure to the Spring Cloud
Connectors data structure.
@param interpolatedData the Spring CredHub data structure
@return the equivalent Spring Cloud Connectors data structure | [
"Convert",
"from",
"the",
"Spring",
"Credhub",
"service",
"data",
"structure",
"to",
"the",
"Spring",
"Cloud",
"Connectors",
"data",
"structure",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-cloud-connector/src/main/java/org/springframework/credhub/cloud/CredHubInterpolationServiceDataPostProcessor.java#L130-L135 |
108,869 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/core/ExceptionUtils.java | ExceptionUtils.throwExceptionOnError | public static void throwExceptionOnError(ResponseEntity<?> response) {
if (!response.getStatusCode().equals(HttpStatus.OK)) {
throw new CredHubException(response.getStatusCode());
}
} | java | public static void throwExceptionOnError(ResponseEntity<?> response) {
if (!response.getStatusCode().equals(HttpStatus.OK)) {
throw new CredHubException(response.getStatusCode());
}
} | [
"public",
"static",
"void",
"throwExceptionOnError",
"(",
"ResponseEntity",
"<",
"?",
">",
"response",
")",
"{",
"if",
"(",
"!",
"response",
".",
"getStatusCode",
"(",
")",
".",
"equals",
"(",
"HttpStatus",
".",
"OK",
")",
")",
"{",
"throw",
"new",
"Cred... | Helper method to throw an appropriate exception if a request to CredHub
returns with an error code.
@param response a {@link ResponseEntity} returned from {@link RestTemplate} | [
"Helper",
"method",
"to",
"throw",
"an",
"appropriate",
"exception",
"if",
"a",
"request",
"to",
"CredHub",
"returns",
"with",
"an",
"error",
"code",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/core/ExceptionUtils.java#L33-L37 |
108,870 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/core/ExceptionUtils.java | ExceptionUtils.buildError | public static Mono<Throwable> buildError(ClientResponse response) {
return Mono.error(new CredHubException(response.statusCode()));
} | java | public static Mono<Throwable> buildError(ClientResponse response) {
return Mono.error(new CredHubException(response.statusCode()));
} | [
"public",
"static",
"Mono",
"<",
"Throwable",
">",
"buildError",
"(",
"ClientResponse",
"response",
")",
"{",
"return",
"Mono",
".",
"error",
"(",
"new",
"CredHubException",
"(",
"response",
".",
"statusCode",
"(",
")",
")",
")",
";",
"}"
] | Helper method to return an appropriate error if a request to CredHub
returns with an error code.
@return the generated error
@param response a {@link ClientResponse} returned from {@link WebClient} | [
"Helper",
"method",
"to",
"return",
"an",
"appropriate",
"error",
"if",
"a",
"request",
"to",
"CredHub",
"returns",
"with",
"an",
"error",
"code",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/core/ExceptionUtils.java#L46-L48 |
108,871 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java | Actor.app | public static Actor app(String appId) {
Assert.notNull(appId, "appId must not be null");
return new Actor(APP, appId);
} | java | public static Actor app(String appId) {
Assert.notNull(appId, "appId must not be null");
return new Actor(APP, appId);
} | [
"public",
"static",
"Actor",
"app",
"(",
"String",
"appId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"appId",
",",
"\"appId must not be null\"",
")",
";",
"return",
"new",
"Actor",
"(",
"APP",
",",
"appId",
")",
";",
"}"
] | Create an application identifier. An application is identified by a GUID generated
by Cloud Foundry when the application is created.
@param appId the Cloud Foundry application GUID
@return the created {@literal Actor} | [
"Create",
"an",
"application",
"identifier",
".",
"An",
"application",
"is",
"identified",
"by",
"a",
"GUID",
"generated",
"by",
"Cloud",
"Foundry",
"when",
"the",
"application",
"is",
"created",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java#L58-L61 |
108,872 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java | Actor.user | public static Actor user(String userId) {
Assert.notNull(userId, "userId must not be null");
return new Actor(USER, userId);
} | java | public static Actor user(String userId) {
Assert.notNull(userId, "userId must not be null");
return new Actor(USER, userId);
} | [
"public",
"static",
"Actor",
"user",
"(",
"String",
"userId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"userId",
",",
"\"userId must not be null\"",
")",
";",
"return",
"new",
"Actor",
"(",
"USER",
",",
"userId",
")",
";",
"}"
] | Create a user identifier. A user is identified by a GUID generated by UAA when
a user account is created.
@param userId the UAA user GUID
@return the created {@literal Actor} | [
"Create",
"a",
"user",
"identifier",
".",
"A",
"user",
"is",
"identified",
"by",
"a",
"GUID",
"generated",
"by",
"UAA",
"when",
"a",
"user",
"account",
"is",
"created",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java#L70-L73 |
108,873 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java | Actor.user | public static Actor user(String zoneId, String userId) {
Assert.notNull(zoneId, "zoneId must not be null");
Assert.notNull(userId, "userId must not be null");
return new Actor(USER, zoneId + "/" + userId);
} | java | public static Actor user(String zoneId, String userId) {
Assert.notNull(zoneId, "zoneId must not be null");
Assert.notNull(userId, "userId must not be null");
return new Actor(USER, zoneId + "/" + userId);
} | [
"public",
"static",
"Actor",
"user",
"(",
"String",
"zoneId",
",",
"String",
"userId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"zoneId",
",",
"\"zoneId must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"userId",
",",
"\"userId must not be null\"",
... | Create a user identifier. A user is identified by a GUID generated by UAA when
a user account is created and the ID of the identity zone the user was created in.
@param zoneId the UAA identity zone ID
@param userId the UAA user GUID
@return the created {@literal Actor} | [
"Create",
"a",
"user",
"identifier",
".",
"A",
"user",
"is",
"identified",
"by",
"a",
"GUID",
"generated",
"by",
"UAA",
"when",
"a",
"user",
"account",
"is",
"created",
"and",
"the",
"ID",
"of",
"the",
"identity",
"zone",
"the",
"user",
"was",
"created",... | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java#L83-L87 |
108,874 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java | Actor.client | public static Actor client(String clientId) {
Assert.notNull(clientId, "clientId must not be null");
return new Actor(OAUTH_CLIENT, clientId);
} | java | public static Actor client(String clientId) {
Assert.notNull(clientId, "clientId must not be null");
return new Actor(OAUTH_CLIENT, clientId);
} | [
"public",
"static",
"Actor",
"client",
"(",
"String",
"clientId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"clientId",
",",
"\"clientId must not be null\"",
")",
";",
"return",
"new",
"Actor",
"(",
"OAUTH_CLIENT",
",",
"clientId",
")",
";",
"}"
] | Create an OAuth2 client identifier. A client identified by user-provided identifier.
@param clientId the UAA client ID
@return the created {@literal Actor} | [
"Create",
"an",
"OAuth2",
"client",
"identifier",
".",
"A",
"client",
"identified",
"by",
"user",
"-",
"provided",
"identifier",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java#L95-L98 |
108,875 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java | Actor.client | public static Actor client(String zoneId, String clientId) {
Assert.notNull(zoneId, "zoneId must not be null");
Assert.notNull(clientId, "clientId must not be null");
return new Actor(OAUTH_CLIENT, zoneId + "/" + clientId);
} | java | public static Actor client(String zoneId, String clientId) {
Assert.notNull(zoneId, "zoneId must not be null");
Assert.notNull(clientId, "clientId must not be null");
return new Actor(OAUTH_CLIENT, zoneId + "/" + clientId);
} | [
"public",
"static",
"Actor",
"client",
"(",
"String",
"zoneId",
",",
"String",
"clientId",
")",
"{",
"Assert",
".",
"notNull",
"(",
"zoneId",
",",
"\"zoneId must not be null\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"clientId",
",",
"\"clientId must not be nu... | Create an OAuth2 client identifier. A client identified by user-provided identifier
and the ID of the identity zone the client was created in.
@param zoneId the UAA identity zone ID
@param clientId the UAA client ID
@return the created {@literal Actor} | [
"Create",
"an",
"OAuth2",
"client",
"identifier",
".",
"A",
"client",
"identified",
"by",
"user",
"-",
"provided",
"identifier",
"and",
"the",
"ID",
"of",
"the",
"identity",
"zone",
"the",
"client",
"was",
"created",
"in",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Actor.java#L108-L112 |
108,876 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Permission.java | Permission.getOperationsAsString | @JsonGetter("operations")
private List<String> getOperationsAsString() {
if (operations == null) {
return null;
}
List<String> operationValues = new ArrayList<>(operations.size());
for (Operation operation : operations) {
operationValues.add(operation.operation());
}
return operationValues;
} | java | @JsonGetter("operations")
private List<String> getOperationsAsString() {
if (operations == null) {
return null;
}
List<String> operationValues = new ArrayList<>(operations.size());
for (Operation operation : operations) {
operationValues.add(operation.operation());
}
return operationValues;
} | [
"@",
"JsonGetter",
"(",
"\"operations\"",
")",
"private",
"List",
"<",
"String",
">",
"getOperationsAsString",
"(",
")",
"{",
"if",
"(",
"operations",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"String",
">",
"operationValues",
"=",
... | Get the set of operations that the actor will be allowed to perform on
the credential.
@return the operations | [
"Get",
"the",
"set",
"of",
"operations",
"that",
"the",
"actor",
"will",
"be",
"allowed",
"to",
"perform",
"on",
"the",
"credential",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/support/permissions/Permission.java#L94-L105 |
108,877 | spring-projects/spring-credhub | spring-credhub-core/src/main/java/org/springframework/credhub/core/CredHubOAuth2RequestInterceptor.java | CredHubOAuth2RequestInterceptor.intercept | @Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body,
ClientHttpRequestExecution execution) throws IOException {
HttpRequestWrapper requestWrapper = new HttpRequestWrapper(request);
HttpHeaders headers = requestWrapper.getHeaders();
headers.setBearerAuth(getAccessToken().getT... | java | @Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body,
ClientHttpRequestExecution execution) throws IOException {
HttpRequestWrapper requestWrapper = new HttpRequestWrapper(request);
HttpHeaders headers = requestWrapper.getHeaders();
headers.setBearerAuth(getAccessToken().getT... | [
"@",
"Override",
"public",
"ClientHttpResponse",
"intercept",
"(",
"HttpRequest",
"request",
",",
"byte",
"[",
"]",
"body",
",",
"ClientHttpRequestExecution",
"execution",
")",
"throws",
"IOException",
"{",
"HttpRequestWrapper",
"requestWrapper",
"=",
"new",
"HttpRequ... | Add an OAuth2 bearer token header to each request.
{@inheritDoc} | [
"Add",
"an",
"OAuth2",
"bearer",
"token",
"header",
"to",
"each",
"request",
"."
] | 4d82cfa60d6c04e707ff32d78bc5d80cff4e132e | https://github.com/spring-projects/spring-credhub/blob/4d82cfa60d6c04e707ff32d78bc5d80cff4e132e/spring-credhub-core/src/main/java/org/springframework/credhub/core/CredHubOAuth2RequestInterceptor.java#L70-L79 |
108,878 | pf4j/pf4j-update | src/main/java/org/pf4j/update/SimpleFileDownloader.java | SimpleFileDownloader.copyLocalFile | protected Path copyLocalFile(URL fileUrl) throws IOException, PluginException {
Path destination = Files.createTempDirectory("pf4j-update-downloader");
destination.toFile().deleteOnExit();
try {
Path fromFile = Paths.get(fileUrl.toURI());
String path = fileUrl.getPath();... | java | protected Path copyLocalFile(URL fileUrl) throws IOException, PluginException {
Path destination = Files.createTempDirectory("pf4j-update-downloader");
destination.toFile().deleteOnExit();
try {
Path fromFile = Paths.get(fileUrl.toURI());
String path = fileUrl.getPath();... | [
"protected",
"Path",
"copyLocalFile",
"(",
"URL",
"fileUrl",
")",
"throws",
"IOException",
",",
"PluginException",
"{",
"Path",
"destination",
"=",
"Files",
".",
"createTempDirectory",
"(",
"\"pf4j-update-downloader\"",
")",
";",
"destination",
".",
"toFile",
"(",
... | Efficient copy of file in case of local file system.
@param fileUrl source file
@return path of target file
@throws IOException if problems during copy
@throws PluginException in case of other problems | [
"Efficient",
"copy",
"of",
"file",
"in",
"case",
"of",
"local",
"file",
"system",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/SimpleFileDownloader.java#L75-L90 |
108,879 | pf4j/pf4j-update | src/main/java/org/pf4j/update/SimpleFileDownloader.java | SimpleFileDownloader.downloadFileHttp | protected Path downloadFileHttp(URL fileUrl) throws IOException, PluginException {
Path destination = Files.createTempDirectory("pf4j-update-downloader");
destination.toFile().deleteOnExit();
String path = fileUrl.getPath();
String fileName = path.substring(path.lastIndexOf('/') + 1);
... | java | protected Path downloadFileHttp(URL fileUrl) throws IOException, PluginException {
Path destination = Files.createTempDirectory("pf4j-update-downloader");
destination.toFile().deleteOnExit();
String path = fileUrl.getPath();
String fileName = path.substring(path.lastIndexOf('/') + 1);
... | [
"protected",
"Path",
"downloadFileHttp",
"(",
"URL",
"fileUrl",
")",
"throws",
"IOException",
",",
"PluginException",
"{",
"Path",
"destination",
"=",
"Files",
".",
"createTempDirectory",
"(",
"\"pf4j-update-downloader\"",
")",
";",
"destination",
".",
"toFile",
"("... | Downloads file from HTTP or FTP.
@param fileUrl source file
@return path of downloaded file
@throws IOException if IO problems
@throws PluginException if validation fails or any other problems | [
"Downloads",
"file",
"from",
"HTTP",
"or",
"FTP",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/SimpleFileDownloader.java#L100-L151 |
108,880 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.getUpdates | public List<PluginInfo> getUpdates() {
List<PluginInfo> updates = new ArrayList<>();
for (PluginWrapper installed : pluginManager.getPlugins()) {
String pluginId = installed.getPluginId();
if (hasPluginUpdate(pluginId)) {
updates.add(getPluginsMap().get(pluginId))... | java | public List<PluginInfo> getUpdates() {
List<PluginInfo> updates = new ArrayList<>();
for (PluginWrapper installed : pluginManager.getPlugins()) {
String pluginId = installed.getPluginId();
if (hasPluginUpdate(pluginId)) {
updates.add(getPluginsMap().get(pluginId))... | [
"public",
"List",
"<",
"PluginInfo",
">",
"getUpdates",
"(",
")",
"{",
"List",
"<",
"PluginInfo",
">",
"updates",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"PluginWrapper",
"installed",
":",
"pluginManager",
".",
"getPlugins",
"(",
")",
"... | Return a list of plugins that are newer versions of already installed plugins.
@return list of plugins that have updates | [
"Return",
"a",
"list",
"of",
"plugins",
"that",
"are",
"newer",
"versions",
"of",
"already",
"installed",
"plugins",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L101-L111 |
108,881 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.getPlugins | public List<PluginInfo> getPlugins() {
List<PluginInfo> list = new ArrayList<>(getPluginsMap().values());
Collections.sort(list);
return list;
} | java | public List<PluginInfo> getPlugins() {
List<PluginInfo> list = new ArrayList<>(getPluginsMap().values());
Collections.sort(list);
return list;
} | [
"public",
"List",
"<",
"PluginInfo",
">",
"getPlugins",
"(",
")",
"{",
"List",
"<",
"PluginInfo",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
"getPluginsMap",
"(",
")",
".",
"values",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"list",
... | Get the list of plugins from all repos.
@return List of plugin info | [
"Get",
"the",
"list",
"of",
"plugins",
"from",
"all",
"repos",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L127-L132 |
108,882 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.getPluginsMap | public Map<String, PluginInfo> getPluginsMap() {
Map<String, PluginInfo> pluginsMap = new HashMap<>();
for (UpdateRepository repository : getRepositories()) {
pluginsMap.putAll(repository.getPlugins());
}
return pluginsMap;
} | java | public Map<String, PluginInfo> getPluginsMap() {
Map<String, PluginInfo> pluginsMap = new HashMap<>();
for (UpdateRepository repository : getRepositories()) {
pluginsMap.putAll(repository.getPlugins());
}
return pluginsMap;
} | [
"public",
"Map",
"<",
"String",
",",
"PluginInfo",
">",
"getPluginsMap",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"PluginInfo",
">",
"pluginsMap",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"UpdateRepository",
"repository",
":",
"getRepositor... | Get a map of all plugins from all repos where key is plugin id.
@return List of plugin info | [
"Get",
"a",
"map",
"of",
"all",
"plugins",
"from",
"all",
"repos",
"where",
"key",
"is",
"plugin",
"id",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L139-L146 |
108,883 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.addRepository | public void addRepository(UpdateRepository newRepo) {
for (UpdateRepository ur : repositories) {
if (ur.getId().equals(newRepo.getId())) {
throw new RuntimeException("Repository with id " + newRepo.getId() + " already exists");
}
}
newRepo.refresh();
... | java | public void addRepository(UpdateRepository newRepo) {
for (UpdateRepository ur : repositories) {
if (ur.getId().equals(newRepo.getId())) {
throw new RuntimeException("Repository with id " + newRepo.getId() + " already exists");
}
}
newRepo.refresh();
... | [
"public",
"void",
"addRepository",
"(",
"UpdateRepository",
"newRepo",
")",
"{",
"for",
"(",
"UpdateRepository",
"ur",
":",
"repositories",
")",
"{",
"if",
"(",
"ur",
".",
"getId",
"(",
")",
".",
"equals",
"(",
"newRepo",
".",
"getId",
"(",
")",
")",
"... | Add a repo that was created by client.
@param newRepo the new UpdateRepository to add to the list | [
"Add",
"a",
"repo",
"that",
"was",
"created",
"by",
"client",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L186-L194 |
108,884 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.removeRepository | public void removeRepository(String id) {
for (UpdateRepository repo : getRepositories()) {
if (id.equals(repo.getId())) {
repositories.remove(repo);
break;
}
}
log.warn("Repository with id " + id + " not found, doing nothing");
} | java | public void removeRepository(String id) {
for (UpdateRepository repo : getRepositories()) {
if (id.equals(repo.getId())) {
repositories.remove(repo);
break;
}
}
log.warn("Repository with id " + id + " not found, doing nothing");
} | [
"public",
"void",
"removeRepository",
"(",
"String",
"id",
")",
"{",
"for",
"(",
"UpdateRepository",
"repo",
":",
"getRepositories",
"(",
")",
")",
"{",
"if",
"(",
"id",
".",
"equals",
"(",
"repo",
".",
"getId",
"(",
")",
")",
")",
"{",
"repositories",... | Remove a repository by id.
@param id of repository to remove | [
"Remove",
"a",
"repository",
"by",
"id",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L201-L209 |
108,885 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.refresh | public synchronized void refresh() {
if (repositoriesJson != null) {
initRepositoriesFromJson();
}
for (UpdateRepository updateRepository : repositories) {
updateRepository.refresh();
}
lastPluginRelease.clear();
} | java | public synchronized void refresh() {
if (repositoriesJson != null) {
initRepositoriesFromJson();
}
for (UpdateRepository updateRepository : repositories) {
updateRepository.refresh();
}
lastPluginRelease.clear();
} | [
"public",
"synchronized",
"void",
"refresh",
"(",
")",
"{",
"if",
"(",
"repositoriesJson",
"!=",
"null",
")",
"{",
"initRepositoriesFromJson",
"(",
")",
";",
"}",
"for",
"(",
"UpdateRepository",
"updateRepository",
":",
"repositories",
")",
"{",
"updateRepositor... | Refreshes all repositories, so they are forced to refresh list of plugins. | [
"Refreshes",
"all",
"repositories",
"so",
"they",
"are",
"forced",
"to",
"refresh",
"list",
"of",
"plugins",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L214-L222 |
108,886 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.installPlugin | public synchronized boolean installPlugin(String id, String version) throws PluginException {
// Download to temporary location
Path downloaded = downloadPlugin(id, version);
Path pluginsRoot = pluginManager.getPluginsRoot();
Path file = pluginsRoot.resolve(downloaded.getFileName());
... | java | public synchronized boolean installPlugin(String id, String version) throws PluginException {
// Download to temporary location
Path downloaded = downloadPlugin(id, version);
Path pluginsRoot = pluginManager.getPluginsRoot();
Path file = pluginsRoot.resolve(downloaded.getFileName());
... | [
"public",
"synchronized",
"boolean",
"installPlugin",
"(",
"String",
"id",
",",
"String",
"version",
")",
"throws",
"PluginException",
"{",
"// Download to temporary location",
"Path",
"downloaded",
"=",
"downloadPlugin",
"(",
"id",
",",
"version",
")",
";",
"Path",... | Installs a plugin by id and version.
@param id the id of plugin to install
@param version the version of plugin to install, on SemVer format, or null for latest
@return true if installation successful and plugin started
@exception PluginException if plugin does not exist in repos or problems during | [
"Installs",
"a",
"plugin",
"by",
"id",
"and",
"version",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L232-L248 |
108,887 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.getFileVerifier | protected FileVerifier getFileVerifier(String pluginId) {
for (UpdateRepository ur : repositories) {
if (ur.getPlugin(pluginId) != null && ur.getFileVerfier() != null) {
return ur.getFileVerfier();
}
}
return new CompoundVerifier();
} | java | protected FileVerifier getFileVerifier(String pluginId) {
for (UpdateRepository ur : repositories) {
if (ur.getPlugin(pluginId) != null && ur.getFileVerfier() != null) {
return ur.getFileVerfier();
}
}
return new CompoundVerifier();
} | [
"protected",
"FileVerifier",
"getFileVerifier",
"(",
"String",
"pluginId",
")",
"{",
"for",
"(",
"UpdateRepository",
"ur",
":",
"repositories",
")",
"{",
"if",
"(",
"ur",
".",
"getPlugin",
"(",
"pluginId",
")",
"!=",
"null",
"&&",
"ur",
".",
"getFileVerfier"... | Gets a file verifier to use for this plugin. First tries to use custom verifier
configured for the repository, then fallback to the default CompoundVerifier
@param pluginId the plugin we wish to download
@return FileVerifier instance | [
"Gets",
"a",
"file",
"verifier",
"to",
"use",
"for",
"this",
"plugin",
".",
"First",
"tries",
"to",
"use",
"custom",
"verifier",
"configured",
"for",
"the",
"repository",
"then",
"fallback",
"to",
"the",
"default",
"CompoundVerifier"
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L293-L301 |
108,888 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.findReleaseForPlugin | protected PluginRelease findReleaseForPlugin(String id, String version) throws PluginException {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
log.info("Plugin with id {} does not exist in any repository", id);
throw new PluginException("Plugin with i... | java | protected PluginRelease findReleaseForPlugin(String id, String version) throws PluginException {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
log.info("Plugin with id {} does not exist in any repository", id);
throw new PluginException("Plugin with i... | [
"protected",
"PluginRelease",
"findReleaseForPlugin",
"(",
"String",
"id",
",",
"String",
"version",
")",
"throws",
"PluginException",
"{",
"PluginInfo",
"pluginInfo",
"=",
"getPluginsMap",
"(",
")",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pluginInfo",
"=... | Resolves Release from id and version.
@param id of plugin
@param version of plugin or null to locate latest version
@return PluginRelease for downloading
@throws PluginException if id or version does not exist | [
"Resolves",
"Release",
"from",
"id",
"and",
"version",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L311-L329 |
108,889 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.getLastPluginRelease | public PluginRelease getLastPluginRelease(String id) {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
return null;
}
if (!lastPluginRelease.containsKey(id)) {
for (PluginRelease release : pluginInfo.releases) {
if (syst... | java | public PluginRelease getLastPluginRelease(String id) {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
return null;
}
if (!lastPluginRelease.containsKey(id)) {
for (PluginRelease release : pluginInfo.releases) {
if (syst... | [
"public",
"PluginRelease",
"getLastPluginRelease",
"(",
"String",
"id",
")",
"{",
"PluginInfo",
"pluginInfo",
"=",
"getPluginsMap",
"(",
")",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pluginInfo",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"i... | Returns the last release version of this plugin for given system version, regardless of release date.
@return PluginRelease which has the highest version number | [
"Returns",
"the",
"last",
"release",
"version",
"of",
"this",
"plugin",
"for",
"given",
"system",
"version",
"regardless",
"of",
"release",
"date",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L384-L403 |
108,890 | pf4j/pf4j-update | src/main/java/org/pf4j/update/UpdateManager.java | UpdateManager.hasPluginUpdate | public boolean hasPluginUpdate(String id) {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
return false;
}
String installedVersion = pluginManager.getPlugin(id).getDescriptor().getVersion();
PluginRelease last = getLastPluginRelease(id);
... | java | public boolean hasPluginUpdate(String id) {
PluginInfo pluginInfo = getPluginsMap().get(id);
if (pluginInfo == null) {
return false;
}
String installedVersion = pluginManager.getPlugin(id).getDescriptor().getVersion();
PluginRelease last = getLastPluginRelease(id);
... | [
"public",
"boolean",
"hasPluginUpdate",
"(",
"String",
"id",
")",
"{",
"PluginInfo",
"pluginInfo",
"=",
"getPluginsMap",
"(",
")",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pluginInfo",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
... | Finds whether the newer version of the plugin.
@return true if there is a newer version available which is compatible with system | [
"Finds",
"whether",
"the",
"newer",
"version",
"of",
"the",
"plugin",
"."
] | 80cf04b8f2790808d0cf9dff3602dc5d730ac979 | https://github.com/pf4j/pf4j-update/blob/80cf04b8f2790808d0cf9dff3602dc5d730ac979/src/main/java/org/pf4j/update/UpdateManager.java#L410-L420 |
108,891 | logic-ng/LogicNG | src/main/java/org/logicng/bdds/orderings/ForceOrdering.java | ForceOrdering.force | private List<Variable> force(final Formula formula, final Hypergraph<Variable> hypergraph,
final Map<Variable, HypergraphNode<Variable>> nodes) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> initialOrdering = createInitialOrdering(formula, nodes);
LinkedHashMap<Hypergrap... | java | private List<Variable> force(final Formula formula, final Hypergraph<Variable> hypergraph,
final Map<Variable, HypergraphNode<Variable>> nodes) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> initialOrdering = createInitialOrdering(formula, nodes);
LinkedHashMap<Hypergrap... | [
"private",
"List",
"<",
"Variable",
">",
"force",
"(",
"final",
"Formula",
"formula",
",",
"final",
"Hypergraph",
"<",
"Variable",
">",
"hypergraph",
",",
"final",
"Map",
"<",
"Variable",
",",
"HypergraphNode",
"<",
"Variable",
">",
">",
"nodes",
")",
"{",... | Executes the main FORCE algorithm.
@param formula the CNF formula for the ordering
@param hypergraph the hypergraph for this formula
@param nodes the variable to hypergraph node mapping
@return the variable ordering according to the FORCE algorithm | [
"Executes",
"the",
"main",
"FORCE",
"algorithm",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/orderings/ForceOrdering.java#L83-L99 |
108,892 | logic-ng/LogicNG | src/main/java/org/logicng/bdds/orderings/ForceOrdering.java | ForceOrdering.createInitialOrdering | private LinkedHashMap<HypergraphNode<Variable>, Integer> createInitialOrdering(final Formula formula, final Map<Variable, HypergraphNode<Variable>> nodes) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> initialOrdering = new LinkedHashMap<>();
final List<Variable> dfsOrder = this.dfsOrdering.getOrder(f... | java | private LinkedHashMap<HypergraphNode<Variable>, Integer> createInitialOrdering(final Formula formula, final Map<Variable, HypergraphNode<Variable>> nodes) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> initialOrdering = new LinkedHashMap<>();
final List<Variable> dfsOrder = this.dfsOrdering.getOrder(f... | [
"private",
"LinkedHashMap",
"<",
"HypergraphNode",
"<",
"Variable",
">",
",",
"Integer",
">",
"createInitialOrdering",
"(",
"final",
"Formula",
"formula",
",",
"final",
"Map",
"<",
"Variable",
",",
"HypergraphNode",
"<",
"Variable",
">",
">",
"nodes",
")",
"{"... | Creates an initial ordering for the variables based on a DFS.
@param formula the CNF formula
@param nodes the variable to hypergraph node mapping
@return the initial variable ordering | [
"Creates",
"an",
"initial",
"ordering",
"for",
"the",
"variables",
"based",
"on",
"a",
"DFS",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/orderings/ForceOrdering.java#L107-L113 |
108,893 | logic-ng/LogicNG | src/main/java/org/logicng/bdds/orderings/ForceOrdering.java | ForceOrdering.orderingFromTentativeNewLocations | private LinkedHashMap<HypergraphNode<Variable>, Integer> orderingFromTentativeNewLocations(final LinkedHashMap<HypergraphNode<Variable>, Double> newLocations) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> ordering = new LinkedHashMap<>();
final List<Map.Entry<HypergraphNode<Variable>, Double>> list =... | java | private LinkedHashMap<HypergraphNode<Variable>, Integer> orderingFromTentativeNewLocations(final LinkedHashMap<HypergraphNode<Variable>, Double> newLocations) {
final LinkedHashMap<HypergraphNode<Variable>, Integer> ordering = new LinkedHashMap<>();
final List<Map.Entry<HypergraphNode<Variable>, Double>> list =... | [
"private",
"LinkedHashMap",
"<",
"HypergraphNode",
"<",
"Variable",
">",
",",
"Integer",
">",
"orderingFromTentativeNewLocations",
"(",
"final",
"LinkedHashMap",
"<",
"HypergraphNode",
"<",
"Variable",
">",
",",
"Double",
">",
"newLocations",
")",
"{",
"final",
"L... | Generates a new integer ordering from tentative new locations of nodes with the double weighting.
@param newLocations the tentative new locations
@return the new integer ordering | [
"Generates",
"a",
"new",
"integer",
"ordering",
"from",
"tentative",
"new",
"locations",
"of",
"nodes",
"with",
"the",
"double",
"weighting",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/bdds/orderings/ForceOrdering.java#L120-L138 |
108,894 | logic-ng/LogicNG | src/main/java/org/logicng/graphs/datastructures/Hypergraph.java | Hypergraph.addEdge | public void addEdge(final Collection<HypergraphNode<T>> nodes) {
final HypergraphEdge<T> edge = new HypergraphEdge<>(nodes);
this.nodes.addAll(nodes);
this.edges.add(edge);
} | java | public void addEdge(final Collection<HypergraphNode<T>> nodes) {
final HypergraphEdge<T> edge = new HypergraphEdge<>(nodes);
this.nodes.addAll(nodes);
this.edges.add(edge);
} | [
"public",
"void",
"addEdge",
"(",
"final",
"Collection",
"<",
"HypergraphNode",
"<",
"T",
">",
">",
"nodes",
")",
"{",
"final",
"HypergraphEdge",
"<",
"T",
">",
"edge",
"=",
"new",
"HypergraphEdge",
"<>",
"(",
"nodes",
")",
";",
"this",
".",
"nodes",
"... | Adds an edges to the hypergraph. The edge is represented by its connected nodes.
@param nodes the nodes of the edge | [
"Adds",
"an",
"edges",
"to",
"the",
"hypergraph",
".",
"The",
"edge",
"is",
"represented",
"by",
"its",
"connected",
"nodes",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/graphs/datastructures/Hypergraph.java#L91-L95 |
108,895 | logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java | SortedStringRepresentation.naryOperator | @Override
protected String naryOperator(final NAryOperator operator, final String opString) {
final List<Formula> operands = new ArrayList<>();
for (final Formula op : operator) {
operands.add(op);
}
final int size = operator.numberOfOperands();
Collections.sort(o... | java | @Override
protected String naryOperator(final NAryOperator operator, final String opString) {
final List<Formula> operands = new ArrayList<>();
for (final Formula op : operator) {
operands.add(op);
}
final int size = operator.numberOfOperands();
Collections.sort(o... | [
"@",
"Override",
"protected",
"String",
"naryOperator",
"(",
"final",
"NAryOperator",
"operator",
",",
"final",
"String",
"opString",
")",
"{",
"final",
"List",
"<",
"Formula",
">",
"operands",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"fin... | Returns the sorted string representation of an n-ary operator.
@param operator the n-ary operator
@param opString the operator string
@return the string representation | [
"Returns",
"the",
"sorted",
"string",
"representation",
"of",
"an",
"n",
"-",
"ary",
"operator",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java#L142-L165 |
108,896 | logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java | SortedStringRepresentation.pbLhs | @Override
protected String pbLhs(final Literal[] operands, final int[] coefficients) {
assert operands.length == coefficients.length;
final List<Literal> sortedOperands = new ArrayList<>();
final List<Integer> sortedCoefficients = new ArrayList<>();
final List<Literal> givenOperands ... | java | @Override
protected String pbLhs(final Literal[] operands, final int[] coefficients) {
assert operands.length == coefficients.length;
final List<Literal> sortedOperands = new ArrayList<>();
final List<Integer> sortedCoefficients = new ArrayList<>();
final List<Literal> givenOperands ... | [
"@",
"Override",
"protected",
"String",
"pbLhs",
"(",
"final",
"Literal",
"[",
"]",
"operands",
",",
"final",
"int",
"[",
"]",
"coefficients",
")",
"{",
"assert",
"operands",
".",
"length",
"==",
"coefficients",
".",
"length",
";",
"final",
"List",
"<",
... | Returns the sorted string representation of the left-hand side of a pseudo-Boolean constraint.
@param operands the literals of the constraint
@param coefficients the coefficients of the constraint
@return the sorted string representation | [
"Returns",
"the",
"sorted",
"string",
"representation",
"of",
"the",
"left",
"-",
"hand",
"side",
"of",
"a",
"pseudo",
"-",
"Boolean",
"constraint",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java#L174-L211 |
108,897 | logic-ng/LogicNG | src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java | SortedStringRepresentation.sortedEquivalence | private String sortedEquivalence(final Equivalence equivalence) {
final Formula right;
final Formula left;
if (this.comparator.compare(equivalence.left(), equivalence.right()) <= 0) {
right = equivalence.right();
left = equivalence.left();
} else {
rig... | java | private String sortedEquivalence(final Equivalence equivalence) {
final Formula right;
final Formula left;
if (this.comparator.compare(equivalence.left(), equivalence.right()) <= 0) {
right = equivalence.right();
left = equivalence.left();
} else {
rig... | [
"private",
"String",
"sortedEquivalence",
"(",
"final",
"Equivalence",
"equivalence",
")",
"{",
"final",
"Formula",
"right",
";",
"final",
"Formula",
"left",
";",
"if",
"(",
"this",
".",
"comparator",
".",
"compare",
"(",
"equivalence",
".",
"left",
"(",
")"... | Returns the string representation of an equivalence.
@param equivalence the equivalence
@return the string representation | [
"Returns",
"the",
"string",
"representation",
"of",
"an",
"equivalence",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/printer/SortedStringRepresentation.java#L219-L232 |
108,898 | logic-ng/LogicNG | src/main/java/org/logicng/solvers/datastructures/LNGHeap.java | LNGHeap.insert | public void insert(int n) {
this.indices.growTo(n + 1, -1);
assert !this.inHeap(n);
this.indices.set(n, this.heap.size());
this.heap.push(n);
this.percolateUp(this.indices.get(n));
} | java | public void insert(int n) {
this.indices.growTo(n + 1, -1);
assert !this.inHeap(n);
this.indices.set(n, this.heap.size());
this.heap.push(n);
this.percolateUp(this.indices.get(n));
} | [
"public",
"void",
"insert",
"(",
"int",
"n",
")",
"{",
"this",
".",
"indices",
".",
"growTo",
"(",
"n",
"+",
"1",
",",
"-",
"1",
")",
";",
"assert",
"!",
"this",
".",
"inHeap",
"(",
"n",
")",
";",
"this",
".",
"indices",
".",
"set",
"(",
"n",... | Inserts a given element in the heap.
@param n the element | [
"Inserts",
"a",
"given",
"element",
"in",
"the",
"heap",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/datastructures/LNGHeap.java#L147-L153 |
108,899 | logic-ng/LogicNG | src/main/java/org/logicng/solvers/datastructures/LNGHeap.java | LNGHeap.removeMin | public int removeMin() {
int x = this.heap.get(0);
this.heap.set(0, this.heap.back());
this.indices.set(this.heap.get(0), 0);
this.indices.set(x, -1);
this.heap.pop();
if (this.heap.size() > 1)
this.percolateDown(0);
return x;
} | java | public int removeMin() {
int x = this.heap.get(0);
this.heap.set(0, this.heap.back());
this.indices.set(this.heap.get(0), 0);
this.indices.set(x, -1);
this.heap.pop();
if (this.heap.size() > 1)
this.percolateDown(0);
return x;
} | [
"public",
"int",
"removeMin",
"(",
")",
"{",
"int",
"x",
"=",
"this",
".",
"heap",
".",
"get",
"(",
"0",
")",
";",
"this",
".",
"heap",
".",
"set",
"(",
"0",
",",
"this",
".",
"heap",
".",
"back",
"(",
")",
")",
";",
"this",
".",
"indices",
... | Removes the minimal element of the heap.
@return the minimal element of the heap | [
"Removes",
"the",
"minimal",
"element",
"of",
"the",
"heap",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/datastructures/LNGHeap.java#L159-L168 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.