On 4/11/06, Stephen Colebourne <[EMAIL PROTECTED]> wrote: > > Martin Cooper wrote: > > Well, they've already got Commons IO, since FileUpload depends on that, > and > > that has FileNameUtils.getName() to get just the file name, so do we > really > > need to add another method in FileUpload that just wraps that call? > > > > String filename = FileNameUtils.getName(item.getName()); > > instead of: > > String file name = item.getName(); > > doesn't seem so onerous. > > The point is not that this code is onerous, but that it is knowledge > about fileuploading that we have not encapsulated in [fileupload].
Because it was specifically not intended to be addressed by FileUpload. As a user of [fileupload] I should be presented with the fact that I > have to make a choice in the API. At the very least, the javadoc for > getName() should provide a full description of the problem. You mean like this? http://jakarta.apache.org/commons/fileupload/apidocs/org/apache/commons/fileupload/FileItem.html#getName() -- Martin Cooper I think I prefer getNameNoPath() as the method name. The reason is that > it will appear next to getName() in IDE auto-complete, thus causing > casual users to stop and think. > > I volunteer to code this (or apply an external patch ;-) if it won't be > -1'ed. > > Stephen > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
