git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278256 13f79535-47bb-0310-9956-ffa450edef68master
@@ -23,6 +23,7 @@ import java.io.FileInputStream; | |||||
import java.io.FileOutputStream; | import java.io.FileOutputStream; | ||||
import java.io.IOException; | import java.io.IOException; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.util.FileUtils; | |||||
import org.apache.tools.bzip2.CBZip2InputStream; | import org.apache.tools.bzip2.CBZip2InputStream; | ||||
/** | /** | ||||
@@ -82,34 +83,10 @@ public class BUnzip2 extends Unpack { | |||||
String msg = "Problem expanding bzip2 " + ioe.getMessage(); | String msg = "Problem expanding bzip2 " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, getLocation()); | throw new BuildException(msg, ioe, getLocation()); | ||||
} finally { | } finally { | ||||
if (bis != null) { | |||||
try { | |||||
bis.close(); | |||||
} catch (IOException ioex) { | |||||
// ignore | |||||
} | |||||
} | |||||
if (fis != null) { | |||||
try { | |||||
fis.close(); | |||||
} catch (IOException ioex) { | |||||
// ignore | |||||
} | |||||
} | |||||
if (out != null) { | |||||
try { | |||||
out.close(); | |||||
} catch (IOException ioex) { | |||||
// ignore | |||||
} | |||||
} | |||||
if (zIn != null) { | |||||
try { | |||||
zIn.close(); | |||||
} catch (IOException ioex) { | |||||
// ignore | |||||
} | |||||
} | |||||
FileUtils.close(bis); | |||||
FileUtils.close(fis); | |||||
FileUtils.close(out); | |||||
FileUtils.close(zIn); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -22,6 +22,7 @@ import java.io.FileOutputStream; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.util.zip.GZIPInputStream; | import java.util.zip.GZIPInputStream; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.util.FileUtils; | |||||
/** | /** | ||||
* Expands a file that has been compressed with the GZIP | * Expands a file that has been compressed with the GZIP | ||||
@@ -70,27 +71,9 @@ public class GUnzip extends Unpack { | |||||
String msg = "Problem expanding gzip " + ioe.getMessage(); | String msg = "Problem expanding gzip " + ioe.getMessage(); | ||||
throw new BuildException(msg, ioe, getLocation()); | throw new BuildException(msg, ioe, getLocation()); | ||||
} finally { | } finally { | ||||
if (fis != null) { | |||||
try { | |||||
fis.close(); | |||||
} catch (IOException ioex) { | |||||
//ignore | |||||
} | |||||
} | |||||
if (out != null) { | |||||
try { | |||||
out.close(); | |||||
} catch (IOException ioex) { | |||||
//ignore | |||||
} | |||||
} | |||||
if (zIn != null) { | |||||
try { | |||||
zIn.close(); | |||||
} catch (IOException ioex) { | |||||
//ignore | |||||
} | |||||
} | |||||
FileUtils.close(fis); | |||||
FileUtils.close(out); | |||||
FileUtils.close(zIn); | |||||
} | } | ||||
} | } | ||||
} | } | ||||