You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2003/08/27 04:01:37 UTC

Re: [io] thoughts on FileUtils methods while improving test coverage


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