mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 20:42:21 +00:00
[JENKINS-42934] Avoid using new FileInputStream / new FileOutputStream
This commit is contained in:
1 parent
4948d6c556
commit
f0cd7ae8ff
41 files changed
+188
-159
No files matched your search
@@ -26,6 +26,7 @@ package hudson;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.nio.file.Files;
|
||||
import org.apache.tools.ant.filters.StringInputStream;
|
||||
import org.junit.Test;
|
||||
import org.xml.sax.SAXException;
|
||||
@@ -151,7 +152,7 @@ public class PluginManagerTest {
|
||||
FileUtils.write(new File(newFolder, manifestPath), SAMPLE_MANIFEST_FILE);
|
||||
|
||||
final File f = new File(tmp.getRoot(), "my.hpi");
|
||||
try(ZipOutputStream out = new ZipOutputStream(new FileOutputStream(f))) {
|
||||
try(ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(f.toPath()))) {
|
||||
ZipEntry e = new ZipEntry(manifestPath);
|
||||
out.putNextEntry(e);
|
||||
byte[] data = SAMPLE_MANIFEST_FILE.getBytes();
|
||||
|
||||
Reference in new issue
Block a user