mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 12:02:20 +00:00
Clean up usages of IOUtils.closeQuietly and related calls (#2830)
* Clean up usages of IOUtils.closeQuietly and related calls predating Java 7. * Review comments from @oleg-nenashev. * Noticed another place where try-with-resources would protect against a potential leak.
This commit is contained in:
1 parent
77804c1451
commit
23cb13aad0
25 files changed
+131
-207
No files matched your search
@@ -33,8 +33,6 @@ import com.thoughtworks.xstream.core.util.Base64Encoder;
|
||||
import hudson.util.IOUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
@@ -174,11 +172,11 @@ public class Main {
|
||||
con.connect();
|
||||
// send the data
|
||||
try (InputStream in = Files.newInputStream(tmpFile.toPath())) {
|
||||
Util.copyStream(in,con.getOutputStream());
|
||||
org.apache.commons.io.IOUtils.copy(in, con.getOutputStream());
|
||||
}
|
||||
|
||||
if(con.getResponseCode()!=200) {
|
||||
Util.copyStream(con.getErrorStream(),System.err);
|
||||
org.apache.commons.io.IOUtils.copy(con.getErrorStream(), System.err);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in new issue
Block a user