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 <fl...@gmail.com> on 2006/05/08 23:11:23 UTC

Re: [fileupload] FileItem.getName() IE prefix

On 4/13/06, Stephen Colebourne <sc...@btopenworld.com> wrote:
> Martin Cooper wrote:
> > Should I be quoting examples of where people have suggested enhancements to
> > Commons IO that you have claimed are out of scope for that component? I seem
> > to remember essentially the same discussion coming up there. Certain methods
> > _could_ be added, but were not. Why?
>
> Scope is always a difficult call. [fileupload] is lucky on this front as
> its scope is naturally much better defined than [io]'s 'stuff that helps
> with io'.
>
> IMHO, this is a repetitive problem that [fileupload] could address
> without a big impact and without further scope creep. But I read a -1
> between the lines, so I'll stop talking :-)

Opening this up again as I want to put it to bed before a 1.1.1/1.2
release. I'm +1 to the change, but I don't see an obvious direction
for applying the change.

I think it's valuable for the most commonly used method in FileUpload
to get a name, to get it uniformally across browsers - while another
less commonly used method would offer up the real String sent by the
browser.

So if I had my druthers, I'd change getName (which I understand we are
tied to for an Activation infterface) functionality and add a
getBrowserSpecifiedName. However, that's an evil thing to do to the
user; though possibly we could do so in a FileUpload 2.0.

My next thought was to add a getFile method which returned a
java.io.File - people could then do what they wanted with that.
However even though that's possible, it would be a bit confusing as it
would imply the File is present on the server.

So next up is to add a new method name for the uniform filename. 
getBasename clashes with a function of the same name but different
functionality in Commons IO, in IO it returns the filename without the
extension whereas I'd presume we'd want the extension here.

The naming problem here is that we want it to be noticeably different
from 'getName', and yet also it should be noticeably the better method
to be calling. These clash and leave names like getFilename too
confusing and names like getUniformFilename too disctinct.

----

So I see three options:

1) [FileUpload 2.0] Make getName() behave uniformally and add a method
to get the real String.
2) [FileUpload 1.1.1] Stick to the javadoc comment.
3) [FileUpload 1.2] Come up with a new method name for the uniform method name.

Any views?

Hen

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