commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Commented] (FILEUPLOAD-251) DiskFileItem#getTempFile() is broken
Date Mon, 17 Feb 2014 02:12:19 GMT


Sebb commented on FILEUPLOAD-251:

On second thoughts, I don't think it is possible to fix this without potentially breaking

Subclasses that override the method must ensure that the same File is returned each time.
This needs to be documented.

> DiskFileItem#getTempFile() is broken
> ------------------------------------
>                 Key: FILEUPLOAD-251
>                 URL:
>             Project: Commons FileUpload
>          Issue Type: Bug
>            Reporter: Sebb
> DiskFileItem#getTempFile() looks wrong.
> Presumably the intention of providing the protected method was to allow the generation
of the path name to be overwritten. This can indeed be done. 
> However, if this is done, the tempFile variable will not be set up, so the path name
won't be cached - unless the overriding method also caches the name.
> The file name needs to agree with the DeferredFileOutputStream that is created. This
is implied in the Javadoc, but is not currently enforced.
> The protected method needs to implement the name generation part only.

This message was sent by Atlassian JIRA

View raw message