Browse Source

FileUtils.close

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@416181 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 19 years ago
parent
commit
094e4cb81a
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/main/org/apache/tools/ant/util/ScriptRunner.java

+ 4
- 3
src/main/org/apache/tools/ant/util/ScriptRunner.java View File

@@ -173,13 +173,14 @@ public class ScriptRunner {


int count = (int) file.length(); int count = (int) file.length();
byte[] data = new byte[count]; byte[] data = new byte[count];
FileInputStream inStream = null;
try { try {
FileInputStream inStream = new FileInputStream(file);
inStream = new FileInputStream(file);
inStream.read(data); inStream.read(data);
inStream.close();
} catch (IOException e) { } catch (IOException e) {
throw new BuildException(e); throw new BuildException(e);
} finally {
FileUtils.close(inStream);
} }


script += new String(data); script += new String(data);


Loading…
Cancel
Save