• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FlushProofOutputStream类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中hudson.util.FlushProofOutputStream的典型用法代码示例。如果您正苦于以下问题:Java FlushProofOutputStream类的具体用法?Java FlushProofOutputStream怎么用?Java FlushProofOutputStream使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FlushProofOutputStream类属于hudson.util包,在下文中一共展示了FlushProofOutputStream类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: doDeployText

点赞 3

import hudson.util.FlushProofOutputStream; //导入依赖的package包/类
/**
 * Sends out the raw console output.
 */
public void doDeployText(StaplerRequest req, StaplerResponse rsp) throws IOException {
    rsp.setContentType("text/plain;charset=UTF-8");
    // Prevent jelly from flushing stream so Content-Length header can be added afterwards
    FlushProofOutputStream out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req));
    try {
        getLogText().writeLogTo(0, out);
    } catch (IOException e) {
        // see comment in writeLogTo() method
        InputStream input = getLogInputStream();
        try {
            IOUtils.copy(input, out);
        } finally {
            IOUtils.closeQuietly(input);
        }
    }
    out.close();
}
 

开发者ID:jenkinsci,
项目名称:deployer-framework-plugin,
代码行数:21,
代码来源:DeployNowRunAction.java

示例2: doLogTail

点赞 3

import hudson.util.FlushProofOutputStream; //导入依赖的package包/类
public void doLogTail(final StaplerRequest req, final StaplerResponse rsp) throws IOException, ServletException {
    rsp.setContentType("text/plain;charset=UTF-8");
    final Joiner joiner = Joiner.on("\n");
    final PlainTextConsoleOutputStream out = new PlainTextConsoleOutputStream(new FlushProofOutputStream(rsp.getCompressedOutputStream(req)));
    try {
        out.write(joiner.join(getLog(5000)).getBytes());
    } catch (final IOException e) {
        // see comment in writeLogTo() method
        final InputStream input = getLogInputStream();
        try {
            IOUtils.copy(input, out);
        } finally {
            IOUtils.closeQuietly(input);
        }
    } finally {
        IOUtils.closeQuietly(out);
    }
}
 

开发者ID:groupon,
项目名称:DotCi,
代码行数:19,
代码来源:DbBackedBuild.java

示例3: doIndex

点赞 2

import hudson.util.FlushProofOutputStream; //导入依赖的package包/类
/**
 * Displays the JSON payload from GitHub. Stapler API.
 *
 * @param req request
 * @param rsp response
 * @throws IOException
 */
public void doIndex(StaplerRequest req, StaplerResponse rsp) throws IOException {
    rsp.setContentType("application/json;charset=UTF-8");
    // Prevent jelly from flushing stream so Content-Length header can be added afterwards
    try (FlushProofOutputStream out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req))) {
        IOUtils.copy(getPayloadFile(), out);
    }
}
 

开发者ID:Affirm,
项目名称:jenkins-plugins,
代码行数:15,
代码来源:TagCause.java

示例4: doPollingLog

点赞 2

import hudson.util.FlushProofOutputStream; //导入依赖的package包/类
/**
 * TODO is it secure?
 */
public void doPollingLog(StaplerRequest req, StaplerResponse rsp) throws IOException {
    rsp.setContentType("text/plain;charset=UTF-8");
    // Prevent jelly from flushing stream so Content-Length header can be added afterwards
    FlushProofOutputStream out = new FlushProofOutputStream(rsp.getCompressedOutputStream(req));
    try {
        getPollingLogText().writeLogTo(0, out);
    } finally {
        closeQuietly(out);
    }
}
 

开发者ID:KostyaSha,
项目名称:github-integration-plugin,
代码行数:14,
代码来源:GitHubPollingLogAction.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)