mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
more convenience methods.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21746 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
57203e3d63
commit
f2aecc5551
1 file changed
+19
@@ -37,6 +37,7 @@ import org.apache.tools.ant.types.FileSet;
|
||||
import org.apache.tools.ant.taskdefs.Chmod;
|
||||
import org.apache.tools.ant.taskdefs.Copy;
|
||||
import org.apache.commons.lang.time.FastDateFormat;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.kohsuke.stapler.Stapler;
|
||||
import org.jvnet.animal_sniffer.IgnoreJRERequirement;
|
||||
|
||||
@@ -404,6 +405,24 @@ public class Util {
|
||||
out.write(buf,0,len);
|
||||
}
|
||||
|
||||
public static void copyStreamAndClose(InputStream in,OutputStream out) throws IOException {
|
||||
try {
|
||||
copyStream(in,out);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyStreamAndClose(Reader in,Writer out) throws IOException {
|
||||
try {
|
||||
copyStream(in,out);
|
||||
} finally {
|
||||
IOUtils.closeQuietly(in);
|
||||
IOUtils.closeQuietly(out);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tokenizes the text separated by delimiters.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user