ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <jesse.gl...@sun.com>
Subject Re: Purpose of FileUtils.close(...)
Date Tue, 25 Jan 2005 00:52:55 GMT
Matt Benson wrote:
> [...] In talking about whether caught Exceptions should at least be
> logged, Jesse mentioned "disk full" as an example. [...] I found a
> blog today [with] a workaround to detect this condition when writing
> with a FOS, using the sync() method of the descriptor available from
> the stream. We could insert this in our own FOS deriving from 
> java.io.FOS; we could write our own FileWriter to use an instance of
> (hypothetically) oata.util.FOS and force the Exception on full disk.
> [...]

This sounds overly complicated to me. Wouldn't it be much easier to use 
a plain FOS, assume that OutputStream.close() will throw an IOException 
if something is broken, as its Javadoc says, and if caught rethrow this 
as a BuildException in the usual way?

-J.

-- 
Jesse Glick <mailto:jesse.glick@sun.com> x22801
NetBeans, Open APIs  <http://www.netbeans.org/>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message