提交 d2fb6d91 编写于 作者: O Oleg Nenashev

Merge pull request #1225 from synopsys-arc-oss/jenkins22693-inputstream-fix

[FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue
......@@ -257,7 +257,12 @@ public class FileParameterValue extends ParameterValue {
public byte[] get() {
try {
return IOUtils.toByteArray(new FileInputStream(file));
FileInputStream inputStream = new FileInputStream(file);
try {
return IOUtils.toByteArray(inputStream);
} finally {
inputStream.close();
}
} catch (IOException e) {
throw new Error(e);
}
......@@ -293,6 +298,7 @@ public class FileParameterValue extends ParameterValue {
public void setFormField(boolean state) {
}
@Deprecated
public OutputStream getOutputStream() throws IOException {
return new FileOutputStream(file);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册