Musachy Barroso wrote:
Fair enough.

My only other issue with this extra try/catch block is that it seems too broad. The inner catch is for Exception, which I think means the outer catch for IOException can never be triggered...

The URI constructor of File says the argument must be "An absolute, hierarchical URI with a scheme equal to "file", a non-empty path component, and undefined authority, query, and fragment components" and if not, it throws IllegalArgumentException. We're still not checking all those conditions, so if it's a bad URI getting handed to the File constructor that we're trying to protect ourselves from, making that catch specific for IllegalArgumentException seems like a good choice. At least if it were trimmed down to RuntimeException, then a valid IOException would get out of the inner try/catch block appropriately...

-Dale

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

Reply via email to