hudson.Util.copyStream()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(272)

本文整理了Java中hudson.Util.copyStream()方法的一些代码示例,展示了Util.copyStream()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.copyStream()方法的具体详情如下:
包路径:hudson.Util
类名称:Util
方法名:copyStream

Util.copyStream介绍

暂无

代码示例

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public static void copyStreamAndClose(Reader in,Writer out) throws IOException {
  try {
    copyStream(in,out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public static void copyStreamAndClose(InputStream in, OutputStream out) throws IOException {
  try {
    copyStream(in, out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public static void copyStreamAndClose(Reader in, Writer out) throws IOException {
  try {
    copyStream(in, out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Writes the raw XML to the given {@link OutputStream}.
 * Stream will not be closed by the implementation.
 * @since 2.1.1
 */
public void writeRawTo(OutputStream os) throws IOException {
  InputStream is = new FileInputStream(file);
  try {
    Util.copyStream(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public static void copyStreamAndClose(InputStream in,OutputStream out) throws IOException {
  try {
    copyStream(in,out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public static void copyStreamAndClose(InputStream in, OutputStream out) throws IOException {
  try {
    copyStream(in, out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

public static void copyStreamAndClose(Reader in, Writer out) throws IOException {
  try {
    copyStream(in, out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: hudson/hudson-2.x

public static void copyStreamAndClose(Reader in,Writer out) throws IOException {
  try {
    copyStream(in,out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: hudson/hudson-2.x

public static void copyStreamAndClose(InputStream in,OutputStream out) throws IOException {
  try {
    copyStream(in,out);
  } finally {
    IOUtils.closeQuietly(in);
    IOUtils.closeQuietly(out);
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

/**
 * Writes the raw XML to the given {@link OutputStream}. Stream will not be
 * closed by the implementation.
 *
 * @since 2.1.1
 */
public void writeRawTo(OutputStream os) throws IOException {
  InputStream is = new FileInputStream(file);
  try {
    Util.copyStream(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Writes the raw XML to the given {@link OutputStream}.
 * Stream will not be closed by the implementation.
 * @since 2.1.1
 */
public void writeRawTo(OutputStream os) throws IOException {
  InputStream is = new FileInputStream(file);
  try {
    Util.copyStream(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * @deprecated Use {@link IOUtils#copy(InputStream, OutputStream)} in a {@code try}-with-resources block
 */
@Deprecated
public static void copyStreamAndClose(@Nonnull InputStream in, @Nonnull OutputStream out) throws IOException {
  try (InputStream _in = in; OutputStream _out = out) { // make sure both are closed, and use Throwable.addSuppressed
    copyStream(in,out);
  }
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

/**
 * @deprecated Use {@link IOUtils#copy(Reader, Writer)} in a {@code try}-with-resources block
 */
@Deprecated
public static void copyStreamAndClose(@Nonnull Reader in, @Nonnull Writer out) throws IOException {
  try (Reader _in = in; Writer _out = out) {
    copyStream(in,out);
  }
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Writes the raw XML to the given {@link OutputStream}.
 * Stream will not be closed by the implementation.
 * @since 2.1.1
 */
public void writeRawTo(OutputStream os) throws IOException {
  InputStream is = new FileInputStream(file);
  try {
    Util.copyStream(is, os);
  } finally {
    is.close();
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Writes the raw XML to the given {@link Writer}.
 * Writer will not be closed by the implementation.
 * @deprecated Safer to use {@link #writeRawTo(OutputStream)}.
 */
@Deprecated
public void writeRawTo(Writer w) throws IOException {
  Reader r = readRaw();
  try {
    Util.copyStream(r,w);
  } finally {
    r.close();
  }
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Void call() throws IOException {
    FileInputStream fis=null;
    try {
      fis = new FileInputStream(new File(remote));
      Util.copyStream(fis,p.getOut());
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(p.getOut());
    }
  }
});

代码示例来源:origin: org.eclipse.hudson/hudson-core

public Void call() throws IOException {
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(new File(remote));
      Util.copyStream(fis, p.getOut());
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(p.getOut());
    }
  }
});

代码示例来源:origin: hudson/hudson-2.x

public Void call() throws IOException {
    FileInputStream fis=null;
    try {
      fis = new FileInputStream(new File(remote));
      Util.copyStream(fis,p.getOut());
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(p.getOut());
    }
  }
});

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

public Void call() throws IOException {
    FileInputStream fis=null;
    try {
      fis = new FileInputStream(new File(remote));
      Util.copyStream(fis,p.getOut());
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(p.getOut());
    }
  }
});

代码示例来源:origin: com.cisco.step.jenkins.plugins/jenkow-plugin

static void generateWfDiagramTo(String wfName, OutputStream out) throws IOException{
  ProcessDefinition pDef = getDeployedWf(wfName);
  InputStream in = JenkowEngine.getEngine().getRepositoryService().getResourceAsStream(pDef.getDeploymentId(),pDef.getDiagramResourceName());
  // TODO kk? should use copyStreamAndClose here?
  Util.copyStream(in,out);
}

相关文章