commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [io] thoughts on FileUtils methods while improving test coverage
Date Wed, 27 Aug 2003 02:01:37 GMT


On Tue, 26 Aug 2003, __matthewHawthorne wrote:

> Here is my rationale for deleting some of the aforementioned methods: in a
> package like [io], there seem to be endless convenience methods that we can
> provide, so I think we should choose our battles wisely.  Methods that
> save a
> user 1 line of code aren't worth it.  We shouldn't be providing methods
> that will
> allow users to remove the java.io.File import from their classes, we
> should be
> trying to replace all of the things that they do with the File objects.

Yep. The String based stuff should be in FilenameUtils. I still think
they're pretty useful as they hide IO as such. One of my most used IO
methods is:

    loadFile(String filename)

which returns null if it couldn't find the file. Even better if it handled
URLs too. It's a bit crappy, but highly useful in programs.

> I'm starting to think that any methods that don't take a java.io.File as
> a parameter
> should be removed.  A lot of the parsing methods are useful and can be
> put in
> the new FilenameUtils class.

That fits an XxxUtils pattern. Utils that act upon Xxx. The first argument
in the XxxUtils.method should be an Xxx. So I agree with you here.

Hen


Mime
View raw message