in github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/wizard/RepositoriesCloneController.java [38:73]
public void doAction(
IdentifiedUser user,
GitHubLogin hubLogin,
HttpServletRequest req,
HttpServletResponse resp,
ControllerErrors errorMgr)
throws ServletException, IOException {
GitImporter gitCloner = cloneProvider.get(req);
gitCloner.reset();
Set<Entry<String, String[]>> params = req.getParameterMap().entrySet();
for (Entry<String, String[]> param : params) {
String paramName = param.getKey();
String[] paramValue = param.getValue();
if (!paramName.startsWith(REPO_PARAM_PREFIX)
|| paramValue.length != 1
|| paramName.split("_").length != 2) {
continue;
}
String repoIdxString = paramName.split("_")[1];
if (!Character.isDigit(repoIdxString.charAt(0))) {
continue;
}
int repoIdx = Integer.parseInt(repoIdxString);
String organisation = req.getParameter(REPO_PARAM_PREFIX + repoIdx + "_organisation");
String repository = req.getParameter(REPO_PARAM_PREFIX + repoIdx + "_repository");
String description = req.getParameter(REPO_PARAM_PREFIX + repoIdx + "_description");
try {
gitCloner.clone(repoIdx, organisation, repository, description);
} catch (Exception e) {
errorMgr.submit(e);
}
}
}