hudsontrayapp.PluginImpl Maven / Gradle / Ivy
package hudsontrayapp;
import java.io.IOException;
import java.io.Writer;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import hudson.Plugin;
import hudson.model.Hudson;
/**
* Entry point of a plugin.
*
*
* There must be one {@link Plugin} class in each plugin.
* See javadoc of {@link Plugin} for more about what can be done on this class.
*
* @author Kohsuke Kawaguchi
* @plugin hudsontrayapp
*/
public class PluginImpl extends Plugin {
public void doLaunch(StaplerRequest req, StaplerResponse res) throws IOException {
res.setHeader("Content-Disposition", "filename=launch.jnlp");
res.setContentType("application/x-java-jnlp-file");
Writer w = res.getWriter();
w.write("");
w.write("");
w.write("");
w.write("Hudson Tray Application ");
w.write("David Hayes ");
w.write(" ");
w.write(" ");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write(" ");
w.write(" ");
w.write("");
w.write("server="); w.write(req.getRootPath()); w.write("/ ");
w.write(" ");
w.write(" ");
w.close();
}
public void doJdic(StaplerRequest req, StaplerResponse res) throws IOException {
res.setHeader("Content-Disposition", "filename=jdic.jnlp");
res.setContentType("application/x-java-jnlp-file");
Writer w = res.getWriter();
w.write("");
w.write("");
w.write("");
w.write("JDesktop Integration Components ");
w.write("Hudson Tray Application ");
w.write(" ");
w.write(" ");
w.write("");
w.write(" ");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write("");
w.write("");
w.write("");
w.write(" ");
w.write(" ");
w.write(" ");
w.close();
}
}