Package org.kohsuke.stapler

Examples of org.kohsuke.stapler.HttpRedirect


            } finally {
                bc.commit();
            }
        } else
        if (req.hasParameter("add"))
            return new HttpRedirect("addSite");

        return new HttpRedirect("./sites");
    }
View Full Code Here


            ProxyConfiguration.getXmlFile().delete();
        } else {
            jenkins.proxy = pc;
            jenkins.proxy.save();
        }
        return new HttpRedirect("advanced");
    }
View Full Code Here

            // Parse the request
            FileItem fileItem = (FileItem) upload.parseRequest(req).get(0);
            String fileName = Util.getFileName(fileItem.getName());
            if("".equals(fileName)){
                return new HttpRedirect("advanced");
            }
            // we allow the upload of the new jpi's and the legacy hpi's 
            if(!fileName.endsWith(".jpi") && !fileName.endsWith(".hpi")){
                throw new Failure(hudson.model.Messages.Hudson_NotAPlugin(fileName));
            }
            final String baseName = FilenameUtils.getBaseName(fileName);
            fileItem.write(new File(rootDir, baseName + ".jpi")); // rename all new plugins to *.jpi
            fileItem.delete();

            PluginWrapper existing = getPlugin(baseName);
            if (existing!=null && existing.isBundled){
                existing.doPin();
            }

            pluginUploaded = true;

            return new HttpRedirect(".");
        } catch (IOException e) {
            throw e;
        } catch (Exception e) {// grrr. fileItem.write throws this
            throw new ServletException(e);
        }
View Full Code Here

     */
    @CLIMethod(name="delete-node")
    public HttpResponse doDoDelete() throws IOException {
        checkPermission(DELETE);
        Jenkins.getInstance().removeNode(getNode());
        return new HttpRedirect("..");
    }
View Full Code Here

        Jenkins.checkGoodName(name);
       
        logRecorders.put(name,new LogRecorder(name));

        // redirect to the config screen
        return new HttpRedirect(name+"/configure");
    }
View Full Code Here

        if(level.equals("inherit"))
            lv = null;
        else
            lv = Level.parse(level.toUpperCase(Locale.ENGLISH));
        Logger.getLogger(name).setLevel(lv);
        return new HttpRedirect("levels");
    }
View Full Code Here

            disconnect(OfflineCause.create(Messages._SlaveComputer_DisconnectedBy(
                    Jenkins.getAuthentication().getName(),
                    offlineMessage!=null ? " : " + offlineMessage : "")
            ));
        }
        return new HttpRedirect(".");
    }
View Full Code Here

    @Override
    public HttpResponse doDoDelete() throws IOException {
        checkPermission(DELETE);
        try {
            getNode().terminate();
            return new HttpRedirect("..");
        } catch (InterruptedException e) {
            return HttpResponses.error(500,e);
        }
    }
View Full Code Here

        // return true to always inject an HTML fragment to perform a test
        return true;
    }

    public HttpResponse doTest() {
        return new HttpRedirect("test-for-reverse-proxy-setup");
    }
View Full Code Here

        if(no!=null) { // dismiss
            disable(true);
            // of course the irony is that this redirect won't work
            return HttpResponses.redirectViaContextPath("/manage");
        } else {
            return new HttpRedirect("https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+says+my+reverse+proxy+setup+is+broken");
        }
    }
View Full Code Here

TOP

Related Classes of org.kohsuke.stapler.HttpRedirect

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.