Skip to content
Permalink
Browse files

Merge pull request #1225 from synopsys-arc-oss/jenkins22693-inputstre…

…am-fix

[FIXED JENKINS-22693] - Properly close InputStreams in FileParameterValue
  • Loading branch information...
oleg-nenashev committed Jun 1, 2014
2 parents e7ca7ae + 8767ddb commit d2fb6d918c97b7b568eeff5b43e7095cbcb5d107
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 d2fb6d9

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