本文整理汇总了Java中org.kohsuke.stapler.StaplerResponse.getOutputStream方法的典型用法代码示例。如果您正苦于以下问题:Java StaplerResponse.getOutputStream方法的具体用法?Java StaplerResponse.getOutputStream怎么用?Java StaplerResponse.getOutputStream使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kohsuke.stapler.StaplerResponse
的用法示例。
在下文中一共展示了StaplerResponse.getOutputStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doPdfReport
import org.kohsuke.stapler.StaplerResponse; //导入方法依赖的package包/类
public void doPdfReport(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("application/pdf");
ServletOutputStream outputStream = rsp.getOutputStream();
File buildDirectory = owner.getRootDir();
File a = new File(buildDirectory, "/checkmarx/" + PDF_REPORT_NAME);
IOUtils.copy(a, outputStream);
outputStream.flush();
outputStream.close();
}
示例2: doOsaPdfReport
import org.kohsuke.stapler.StaplerResponse; //导入方法依赖的package包/类
public void doOsaPdfReport(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("application/pdf");
ServletOutputStream outputStream = rsp.getOutputStream();
File buildDirectory = owner.getRootDir();
File a = new File(buildDirectory, "/checkmarx/" + OSA_PDF_REPORT_NAME);
IOUtils.copy(a, outputStream);
outputStream.flush();
outputStream.close();
}
示例3: doOsaHtmlReport
import org.kohsuke.stapler.StaplerResponse; //导入方法依赖的package包/类
public void doOsaHtmlReport(StaplerRequest req, StaplerResponse rsp) throws IOException {
rsp.setContentType("text/html");
ServletOutputStream outputStream = rsp.getOutputStream();
File buildDirectory = owner.getRootDir();
File a = new File(buildDirectory, "/checkmarx/" + "OSAReport.html");
IOUtils.copy(a, outputStream);
outputStream.flush();
outputStream.close();
}
示例4: doAjaxQueryHistorico
import org.kohsuke.stapler.StaplerResponse; //导入方法依赖的package包/类
public void doAjaxQueryHistorico(StaplerRequest request, StaplerResponse response) throws Exception {
int streamsize = 0;
if(request.getParameter("streamsize") != null){
streamsize = Integer.parseInt(request.getParameter("streamsize"));
}
Job job = new Job(request.getParameter("job"));
Execution exec = new Execution(request.getParameter("exec"), job.getId());
String historico = exec.consultarHistoricoExec(request.getParameter("stream"), streamsize);
try {
ServletOutputStream out = response.getOutputStream();
out.write((historico).getBytes("UTF-8"));
} catch (IOException e) {
System.out.println(e);
}
}
示例5: generateResponse
import org.kohsuke.stapler.StaplerResponse; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
public void generateResponse(StaplerRequest req, StaplerResponse resp, Object node) throws IOException,
ServletException {
resp.setStatus(HttpServletResponse.SC_OK);
resp.setHeader(CACHE_CONTROL, NO_CACHE);
resp.setContentType(PLAIN_TEXT_CONTENT_TYPE);
final OutputStream output = resp.getOutputStream();
try {
threadDump.dump(output);
} finally {
output.close();
}
}