mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 11:06:25 +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
@@ -45,16 +45,15 @@ import javax.xml.parsers.ParserConfigurationException;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.io.StringWriter;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
/**
|
||||
* Represents an XML data file that Jenkins uses as a data file.
|
||||
@@ -228,7 +227,7 @@ public final class XmlFile {
|
||||
*/
|
||||
public void writeRawTo(Writer w) throws IOException {
|
||||
try (Reader r = readRaw()) {
|
||||
Util.copyStream(r, w);
|
||||
IOUtils.copy(r, w);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user