Skip to content

Commit

Permalink
Merge cfd9b09 into d0bdd17
Browse files Browse the repository at this point in the history
  • Loading branch information
youngmit committed Dec 21, 2018
2 parents d0bdd17 + cfd9b09 commit 7014bf3
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.commons.io.IOUtils;

import java.io.IOException;
import java.io.InputStream;

import hudson.FilePath;

Expand Down Expand Up @@ -80,7 +81,17 @@ public String getRemoteFile() throws InterruptedException, IOException {
maxLength = (int) source.length();
}
byte[] buffer = new byte[maxLength];
IOUtils.read(source.read(), buffer);
InputStream stream = source.read();

try {
IOUtils.read(stream, buffer);
} finally {
try {
if (stream != null) {
stream.close();
}
} catch (IOException e) { /* ignore */ }
}

return new String(buffer);
}
Expand Down

0 comments on commit 7014bf3

Please sign in to comment.