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

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

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

Util.copyStream介绍

暂无

代码示例

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

  1. public static void copyStreamAndClose(Reader in,Writer out) throws IOException {
  2. try {
  3. copyStream(in,out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(InputStream in, OutputStream out) throws IOException {
  2. try {
  3. copyStream(in, out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(Reader in, Writer out) throws IOException {
  2. try {
  3. copyStream(in, out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. /**
  2. * Writes the raw XML to the given {@link OutputStream}.
  3. * Stream will not be closed by the implementation.
  4. * @since 2.1.1
  5. */
  6. public void writeRawTo(OutputStream os) throws IOException {
  7. InputStream is = new FileInputStream(file);
  8. try {
  9. Util.copyStream(is, os);
  10. } finally {
  11. is.close();
  12. }
  13. }

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

  1. public static void copyStreamAndClose(InputStream in,OutputStream out) throws IOException {
  2. try {
  3. copyStream(in,out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(InputStream in, OutputStream out) throws IOException {
  2. try {
  3. copyStream(in, out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(Reader in, Writer out) throws IOException {
  2. try {
  3. copyStream(in, out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(Reader in,Writer out) throws IOException {
  2. try {
  3. copyStream(in,out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. public static void copyStreamAndClose(InputStream in,OutputStream out) throws IOException {
  2. try {
  3. copyStream(in,out);
  4. } finally {
  5. IOUtils.closeQuietly(in);
  6. IOUtils.closeQuietly(out);
  7. }
  8. }

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

  1. /**
  2. * Writes the raw XML to the given {@link OutputStream}. Stream will not be
  3. * closed by the implementation.
  4. *
  5. * @since 2.1.1
  6. */
  7. public void writeRawTo(OutputStream os) throws IOException {
  8. InputStream is = new FileInputStream(file);
  9. try {
  10. Util.copyStream(is, os);
  11. } finally {
  12. is.close();
  13. }
  14. }

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

  1. /**
  2. * Writes the raw XML to the given {@link OutputStream}.
  3. * Stream will not be closed by the implementation.
  4. * @since 2.1.1
  5. */
  6. public void writeRawTo(OutputStream os) throws IOException {
  7. InputStream is = new FileInputStream(file);
  8. try {
  9. Util.copyStream(is, os);
  10. } finally {
  11. is.close();
  12. }
  13. }

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

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

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

  1. /**
  2. * @deprecated Use {@link IOUtils#copy(Reader, Writer)} in a {@code try}-with-resources block
  3. */
  4. @Deprecated
  5. public static void copyStreamAndClose(@Nonnull Reader in, @Nonnull Writer out) throws IOException {
  6. try (Reader _in = in; Writer _out = out) {
  7. copyStream(in,out);
  8. }
  9. }

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

  1. /**
  2. * Writes the raw XML to the given {@link OutputStream}.
  3. * Stream will not be closed by the implementation.
  4. * @since 2.1.1
  5. */
  6. public void writeRawTo(OutputStream os) throws IOException {
  7. InputStream is = new FileInputStream(file);
  8. try {
  9. Util.copyStream(is, os);
  10. } finally {
  11. is.close();
  12. }
  13. }

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

  1. /**
  2. * Writes the raw XML to the given {@link Writer}.
  3. * Writer will not be closed by the implementation.
  4. * @deprecated Safer to use {@link #writeRawTo(OutputStream)}.
  5. */
  6. @Deprecated
  7. public void writeRawTo(Writer w) throws IOException {
  8. Reader r = readRaw();
  9. try {
  10. Util.copyStream(r,w);
  11. } finally {
  12. r.close();
  13. }
  14. }

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

  1. public Void call() throws IOException {
  2. FileInputStream fis=null;
  3. try {
  4. fis = new FileInputStream(new File(remote));
  5. Util.copyStream(fis,p.getOut());
  6. return null;
  7. } finally {
  8. IOUtils.closeQuietly(fis);
  9. IOUtils.closeQuietly(p.getOut());
  10. }
  11. }
  12. });

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

  1. public Void call() throws IOException {
  2. FileInputStream fis = null;
  3. try {
  4. fis = new FileInputStream(new File(remote));
  5. Util.copyStream(fis, p.getOut());
  6. return null;
  7. } finally {
  8. IOUtils.closeQuietly(fis);
  9. IOUtils.closeQuietly(p.getOut());
  10. }
  11. }
  12. });

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

  1. public Void call() throws IOException {
  2. FileInputStream fis=null;
  3. try {
  4. fis = new FileInputStream(new File(remote));
  5. Util.copyStream(fis,p.getOut());
  6. return null;
  7. } finally {
  8. IOUtils.closeQuietly(fis);
  9. IOUtils.closeQuietly(p.getOut());
  10. }
  11. }
  12. });

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

  1. public Void call() throws IOException {
  2. FileInputStream fis=null;
  3. try {
  4. fis = new FileInputStream(new File(remote));
  5. Util.copyStream(fis,p.getOut());
  6. return null;
  7. } finally {
  8. IOUtils.closeQuietly(fis);
  9. IOUtils.closeQuietly(p.getOut());
  10. }
  11. }
  12. });

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

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

相关文章