当前位置: 首页>>代码示例>>Java>>正文


Java LineTransformationOutputStream类代码示例

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


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

示例1: decorateLogger

import hudson.console.LineTransformationOutputStream; //导入依赖的package包/类
@Override public OutputStream decorateLogger(AbstractBuild _ignore, final OutputStream logger) throws IOException, InterruptedException {
    final Pattern p = Pattern.compile(pattern.getPlainText());
    return new LineTransformationOutputStream() {
        @Override protected void eol(byte[] b, int len) throws IOException {
            if (!p.toString().isEmpty()) {
                Matcher m = p.matcher(new String(b, 0, len, charsetName));
                if (m.find()) {
                    logger.write(m.replaceAll("****").getBytes(charsetName));
                } else {
                    // Avoid byte → char → byte conversion unless we are actually doing something.
                    logger.write(b, 0, len);
                }
            } else {
                // Avoid byte → char → byte conversion unless we are actually doing something.
                logger.write(b, 0, len);
            }
        }
    };
}
 
开发者ID:jenkinsci,项目名称:credentials-binding-plugin,代码行数:20,代码来源:BindingStep.java

示例2: decorateLogger

import hudson.console.LineTransformationOutputStream; //导入依赖的package包/类
@SuppressWarnings("rawtypes") // inherited
@Override public OutputStream decorateLogger(AbstractBuild _ignore, final OutputStream logger) throws IOException, InterruptedException {
    return new LineTransformationOutputStream() {
        @Override protected void eol(byte[] b, int len) throws IOException {
            logger.write(new String(b, 0, len).toUpperCase(Locale.ROOT).getBytes());
        }
    };
}
 
开发者ID:10000TB,项目名称:Jenkins-Plugin-Examples,代码行数:9,代码来源:CoreWrapperStepTest.java

示例3: decorateLogger

import hudson.console.LineTransformationOutputStream; //导入依赖的package包/类
@Override public OutputStream decorateLogger(final AbstractBuild build, final OutputStream logger) throws IOException, InterruptedException {
    return new LineTransformationOutputStream() {
        Pattern p;

        @Override protected void eol(byte[] b, int len) throws IOException {
            if (p == null) {
                p = getPatternForBuild(build);
            }

            if (p != null && !p.toString().isEmpty()) {
                Matcher m = p.matcher(new String(b, 0, len, charsetName));
                if (m.find()) {
                    logger.write(m.replaceAll("****").getBytes(charsetName));
                } else {
                    // Avoid byte → char → byte conversion unless we are actually doing something.
                    logger.write(b, 0, len);
                }
            } else {
                // Avoid byte → char → byte conversion unless we are actually doing something.
                logger.write(b, 0, len);
            }
        }

        @Override public void close() throws IOException {
            super.close();
            logger.close();
        }
    };
}
 
开发者ID:jenkinsci,项目名称:credentials-binding-plugin,代码行数:30,代码来源:SecretBuildWrapper.java


注:本文中的hudson.console.LineTransformationOutputStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。