ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kev Jackson <>
Subject FileUtils.close()
Date Tue, 21 Jun 2005 10:01:08 GMT
This came up before, but I forgot what the consensus was (been a while 
since I've had time to play with Ant).  Whenever FileUtils.close() is 
used, any resulting exceptions are swallowed and no logging is 
performed.  I'd like to propose that instead of this "silent death" for 
close, that there is instead a record of what happened, but that the 
record is voluntary

     * Close a stream without throwing any exception.
     * Record message on tasks log for tracability
     * @param device stream, can be null
     * @param user task calling this method
     * @param message message to log in case of IOException
    public static void close(OutputStream device, Task user, String 
message) {
        if (device != null) {
            try {
            } catch (IOException ioex) {

In use...

    } finally {
          FileUtils.close(os, this, "Failed to close output stream 
during method foo");


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message