Okay, time to put this baby to sleep (and I wish that was a metaphor!
he's always hungry).
A first question to ask is, what is the class FilenameUtils for? The
immediate answer is utilities for filenames. ie) the Wildcard code.
Here's the list of methods in FilenameUtils, with comments:
// 1) These 3 should be deleted. They are file based, not filename based.
boolean fileExists(String fileName)
void fileDelete(String fileName)
void mkdir(String dir)
// 2) These are all simple with Lang StringUtils; but acceptable as semantic.
String removeExtension(String filename)
String getExtension(String filename)
String removePath(String filepath)
String getPath(String filepath)
// 2.1) Not convinced these two should exist. People should use
StringUtils if they're not
// dealing with their own file-system.
String removePath(String filepath,char fileSeparatorChar)
String getPath(String filepath,char fileSeparatorChar)
// 3) This one does make sense, but it's UNIX specific currently. It's
the one that should have a fileSeparatorChar argument.
String normalize(String path)
// 4) Less compelling, but seems acceptable. It works on MS and UNIX.
String catPath(String lookupPath, String path)
// 5) Not impressed by this one. I'm not convinced it would actually
work. catPath relies on it.
int indexOfLastPathSeparator(String path)
// 6) Not a huge fan of this method. baseFile is an optional parameter
by looks of it; it lacks a good use-case as an example; but it is at
least filename based to a certain extent.
File resolveFile(File baseFile, String filename)
Looking at the above; I'd like to kill 1), 2.1), 4) and 5) and
consider the death of 6).
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.
So, any disagreements to the above?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]