commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: [fileupload] FileItem.getName() IE prefix
Date Tue, 11 Apr 2006 23:56:07 GMT
On 4/11/06, Stephen Colebourne <scolebourne@btopenworld.com> 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: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message