Skip to content
Permalink
Browse files

[FIXED JENKINS-22693] - Properly close InputStreams in FileParameterV…

…alue

Signed-off-by: Oleg Nenashev <o.v.nenashev@gmail.com>
  • Loading branch information...
oleg-nenashev committed May 5, 2014
1 parent 1568a8b commit 8767ddb192cf752c7d28f512884b9ecd3b9cdbd4
Showing with 7 additions and 1 deletion.
  1. +7 −1 core/src/main/java/hudson/model/FileParameterValue.java
@@ -257,7 +257,12 @@ public long getSize() {

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 boolean isFormField() {
public void setFormField(boolean state) {
}

@Deprecated
public OutputStream getOutputStream() throws IOException {
return new FileOutputStream(file);
}

0 comments on commit 8767ddb

Please sign in to comment.
You can’t perform that action at this time.