commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [io] FilenameUtils
Date Sat, 30 Oct 2004 22:49:06 GMT
From: "Martin Cooper" <mfncooper@gmail.com>
> I expected that FilenameUtils would manipulate file names, no more, no
less.
The 3 File manipulation methods have now gone.

> > > 7) There are also two private methods. internalize and externalize.
> > > Nothing uses the latter and the former is used by getExtension only
> > > and should be inlined into its code. There is also an unused
> > > INTERNAL_SEPARATOR variable that needs killing.
> > I would vote to make them public. separatorsToUnix(),
separatorsToWindows(),
> > plus separatorsToSystem()
>
> I deliberately didn't do that, because that isn't the intended
> semantic. The intent is to convert to some internal form that we
> standardise on amongst ourselves. It wouldn't matter if that internal
> form used '?' as the separator. I happened to choose '/' based on
> earlier comments on what the JDK does, but I certainly didn't think of
> that as converting the separators to Unix style. Also, I made these
> methods private because whatever we decide as for an internal form
> shouldn't matter to any use of the class.

It may be that internalize is a separate concept. For the moment, I have
added the public separatorsToXxx methods as they seem to have a logical fit
on a class about filenames.

I also renamed indexOfLastPathSeparator to indexOfLastSeparator, as a path
separator has a specific other meaning on the File class. There is now an
indexOfExtension method too, plus the beginnings of better class javadoc.

Stephen



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


Mime
View raw message