From 570e3e6bc0909c1a365e10027edc0263fe9c4f56 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 30 Jun 2010 15:45:26 +0000 Subject: [PATCH] added another convenience method. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@32396 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/util/IOUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/main/java/hudson/util/IOUtils.java b/core/src/main/java/hudson/util/IOUtils.java index 30bad0a681..a5275232c8 100644 --- a/core/src/main/java/hudson/util/IOUtils.java +++ b/core/src/main/java/hudson/util/IOUtils.java @@ -14,6 +14,14 @@ import java.io.OutputStream; * @since 1.337 */ public class IOUtils extends org.apache.commons.io.IOUtils { + /** + * Drains the input stream and closes it. + */ + public static void drain(InputStream in) throws IOException { + copy(in,new NullStream()); + in.close(); + } + public static void copy(File src, OutputStream out) throws IOException { FileInputStream in = new FileInputStream(src); try { -- GitLab