commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FILEUPLOAD-235) FileItem.getName() does not conform to the Java getName behaviour and *returns* a full path when provided with one
Date Thu, 11 Jul 2013 02:29:48 GMT

     [ https://issues.apache.org/jira/browse/FILEUPLOAD-235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

David updated FILEUPLOAD-235:
-----------------------------

    Summary: FileItem.getName() does not conform to the Java getName behaviour and *returns*
a full path when provided with one  (was: FileItem.getName() breaks the java File class and
*returns* a full path when provided with one)
    
> FileItem.getName() does not conform to the Java getName behaviour and *returns* a full
path when provided with one
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: FILEUPLOAD-235
>                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-235
>             Project: Commons FileUpload
>          Issue Type: Bug
>    Affects Versions: 1.3
>            Reporter: David
>
> I understand that FileItem is simply following RFC 1867, but the implementation of 'getName'

> method on a file related class IMHO should follow the behaviour of the java File class
which
> bq. Returns the name of the file or directory denoted by this abstract pathname. This
is just the last name in the pathname's name sequence. If the pathname's name sequence is
empty, then the empty string is returned. http://docs.oracle.com/javase/7/docs/api/java/io/File.html#getName()
> I propose that FileItem.getName() is changed to *match* the java File class behaviour
and that another method called something like 'getRawName' be added to the FileItem class.
The rational for this change is to make it less easy to shoot oneself in the foot (in no modern
web application is a 'full filepath' useful, especially when most browsers do not send one!).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message