/** * Performs the installation of the plugins. */ @RequirePOST public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); Set<String> plugins = new LinkedHashSet<>(); Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if(n.startsWith("plugin.")) { n = n.substring(7); plugins.add(n); } } boolean dynamicLoad = req.getParameter("dynamicLoad")!=null; install(plugins, dynamicLoad); rsp.sendRedirect("../updateCenter/"); }
@RequirePOST public HttpResponse doSubmit(StaplerRequest req) throws IOException { String whitelist = Util.fixNull(req.getParameter("whitelist")); if (!whitelist.endsWith("\n")) whitelist+="\n"; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); if (name.startsWith("class:")) { whitelist += name.substring(6)+"\n"; } } whitelisted.set(whitelist); String newRules = Util.fixNull(req.getParameter("filePathRules")); filePathRules.parseTest(newRules); // test first before writing a potentially broken rules filePathRules.set(newRules); return HttpResponses.redirectToDot(); }
/** * Parses the submitted form (where possible values are * presented as a list of checkboxes) and creates an axis */ public static Axis parsePrefixed(StaplerRequest req, String name) { List<String> values = new ArrayList<String>(); String prefix = name+'.'; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String paramName = (String) e.nextElement(); if(paramName.startsWith(prefix)) values.add(paramName.substring(prefix.length())); } if(values.isEmpty()) return null; return new Axis(name,values); }
/** * Parses the submitted form (where possible values are * presented as a list of checkboxes) and creates an axis */ public static Axis parsePrefixed(StaplerRequest req, String name) { List<String> values = new ArrayList<String>(); String prefix = name+'.'; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String paramName = (String) e.nextElement(); if(paramName.startsWith(prefix)) values.add(paramName.substring(prefix.length())); } if(values.isEmpty()) return null; return new Axis(name,values); }
/** * Parses the submitted form (where possible values are * presented as a list of checkboxes) and creates an axis */ public static Axis parsePrefixed(StaplerRequest req, String name) { List<String> values = new ArrayList<String>(); String prefix = name+'.'; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String paramName = (String) e.nextElement(); if(paramName.startsWith(prefix)) values.add(paramName.substring(prefix.length())); } if(values.isEmpty()) return null; return new Axis(name,values); }
/** * Parses the submitted form (where possible values are * presented as a list of checkboxes) and creates an axis */ public static Axis parsePrefixed(StaplerRequest req, String name) { List<String> values = new ArrayList<String>(); String prefix = name+'.'; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String paramName = (String) e.nextElement(); if(paramName.startsWith(prefix)) values.add(paramName.substring(prefix.length())); } if(values.isEmpty()) return null; return new Axis(name,values); }
/** * Parses the submitted form (where possible values are presented as a list * of checkboxes) and creates an axis */ public static Axis parsePrefixed(StaplerRequest req, String name) { List<String> values = new ArrayList<String>(); String prefix = name + '.'; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String paramName = (String) e.nextElement(); if (paramName.startsWith(prefix)) { values.add(paramName.substring(prefix.length())); } } if (values.isEmpty()) { return null; } return new Axis(name, values); }
@Override protected void doPerModuleVersioning(StaplerRequest req) { releaseVersionPerModule = Maps.newHashMap(); nextVersionPerModule = Maps.newHashMap(); Enumeration params = req.getParameterNames(); while (params.hasMoreElements()) { String key = (String) params.nextElement(); if (key.startsWith("release.")) { releaseVersionPerModule.put(StringUtils.removeStart(key, "release."), req.getParameter(key)); } else if (key.startsWith("next.")) { nextVersionPerModule.put(StringUtils.removeStart(key, "next."), req.getParameter(key)); } } }
@Override protected void doPerModuleVersioning(StaplerRequest req) { releaseVersionPerModule = Maps.newHashMap(); nextVersionPerModule = Maps.newHashMap(); Enumeration params = req.getParameterNames(); while (params.hasMoreElements()) { String key = (String) params.nextElement(); if (key.startsWith("release.")) { ModuleName moduleName = ModuleName.fromString(StringUtils.removeStart(key, "release.")); releaseVersionPerModule.put(moduleName, req.getParameter(key)); } else if (key.startsWith("next.")) { ModuleName moduleName = ModuleName.fromString(StringUtils.removeStart(key, "next.")); nextVersionPerModule.put(moduleName, req.getParameter(key)); } } }
/** * Performs the installation of the plugins. */ @RequirePOST public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER); Set<String> plugins = new LinkedHashSet<>(); Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if(n.startsWith("plugin.")) { n = n.substring(7); plugins.add(n); } } boolean dynamicLoad = req.getParameter("dynamicLoad")!=null; install(plugins, dynamicLoad); rsp.sendRedirect("../updateCenter/"); }
/** * Performs the installation of the plugins. */ public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if(n.startsWith("plugin.")) { n = n.substring(7); if (n.indexOf(".") > 0) { String[] pluginInfo = n.split("\\."); UpdateSite.Plugin p = Hudson.getInstance().getUpdateCenter().getById(pluginInfo[1]).getPlugin(pluginInfo[0]); if(p==null) throw new Failure("No such plugin: "+n); p.deploy(); } } } rsp.sendRedirect("../updateCenter/"); }
/** * Performs the installation of the plugins. */ public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if(n.startsWith("plugin.")) { n = n.substring(7); if (n.indexOf(".") > 0) { String[] pluginInfo = n.split("\\."); UpdateSite.Plugin p = Hudson.getInstance().getUpdateCenter().getById(pluginInfo[1]).getPlugin(pluginInfo[0]); if(p==null) throw new Failure("No such plugin: "+n); p.deploy(); } } } rsp.sendRedirect("../updateCenter/"); }
/** * Performs the installation of the plugins. */ public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if(n.startsWith("plugin.")) { n = n.substring(7); if (n.indexOf(".") > 0) { String[] pluginInfo = n.split("\\."); UpdateSite.Plugin p = Hudson.getInstance().getUpdateCenter().getById(pluginInfo[1]).getPlugin(pluginInfo[0]); if(p==null) throw new Failure("No such plugin: "+n); p.deploy(); } } } rsp.sendRedirect("../updateCenter/"); }
/** * Performs the installation of the plugins. */ public void doInstall(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { Enumeration<String> en = req.getParameterNames(); while (en.hasMoreElements()) { String n = en.nextElement(); if (n.startsWith("plugin.")) { n = n.substring(7); if (n.indexOf(".") > 0) { String[] pluginInfo = n.split("\\."); UpdateSite.Plugin p = Hudson.getInstance().getUpdateCenter().getById(pluginInfo[1]).getPlugin(pluginInfo[0]); if (p == null) { throw new Failure("No such plugin: " + n); } p.deploy(); } } } rsp.sendRedirect("../updateCenter/"); }
@RequirePOST public HttpResponse doSubmit(StaplerRequest req) throws IOException { jenkins.checkPermission(Jenkins.RUN_SCRIPTS); String whitelist = Util.fixNull(req.getParameter("whitelist")); if (!whitelist.endsWith("\n")) whitelist+="\n"; Enumeration e = req.getParameterNames(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); if (name.startsWith("class:")) { whitelist += name.substring(6)+"\n"; } } whitelisted.set(whitelist); String newRules = Util.fixNull(req.getParameter("filePathRules")); filePathRules.parseTest(newRules); // test first before writing a potentially broken rules filePathRules.set(newRules); return HttpResponses.redirectToDot(); }
Enumeration e = req.getParameterNames(); Map<AbstractProject, Integer> upstreams
Enumeration e = req.getParameterNames(); Map<AbstractProject, Integer> upstreams