On Jan 6, 2008 9:18 AM, Stephen Colebourne <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > +    public static boolean deleteQuietly(File file) {
> > +        if (file == null) {
> > +            return false;
> > +        }
> > +        try {
> > +            if (file.isDirectory()) {
> > +                cleanDirectory(file);
> > +            }
> > +        } catch (Throwable t) {
> > +        }
> > +
> > +        try {
> > +            return file.delete();
> > +        } catch (Throwable t) {
> > +            return false;
> > +        }
>
> I think I would prefer catch(Exception) rather than catch(Throwable).
> Hiding an OutOfMemoryError (and similar) is generally a Bad Idea. Is
> there a specific use case for catching Throwable?

Good point - I've modified this as you suggest:

http://svn.apache.org/viewvc?view=rev&revision=609395

Niall

> Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to