commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <>
Subject Re: Recent change to FileUpload's DefaultFileItem
Date Wed, 30 Apr 2003 16:24:29 GMT

On Wed, 30 Apr 2003, Robert Leland wrote:

> Martin Cooper wrote:
> >
> > On Wed, 30 Apr 2003, Howard M. Lewis Ship wrote:
> >
> >
> >>
> >>/commons/fileupload/
> >>
> >>Tapestry uses the DefaultFileItem.getStoreLocation() method, which has been
> >>removed.
> >
> >
> > That method was not removed - it is still there, with the same signature -
> > so there must be something else that's causing a breakage.
> It was removed from the FileItem. We normally transfer 100MB to 500 MB
> files. Making copies of files that already exist on a disk is slow and
> can add more than a minute to the transfer time which was only 4 minutes
> to start with. The getStoreLocation() allowed a fast rename() to take place.

It was removed from FileItem because it is tied to Files. FileItem needs
to be generic enough that you could use it for storage elsewhere, such as
in a database, without any lingering remnants of file system specific
storage left in the interface.

This is why there is now a DiskFileUpload class, as well as FileUpload
which is now much more generic.

How about if I create a DiskFileItem interface that extends FileItem and
is implemented by DefaultFileItem and exposed by DiskFileUpload? WOuld
that do the trick?

> Previously we depended on if getStoreLocation() returned a null then we
> had to do stream copy for the smaller files.

The determination of whether the item is in memory or on disk can be made
using FileItem.isInMemory().

> We were also running with a
> modified version of Struts to expose the getStoreLocation() to the
> application. I had planned to make this small change in Struts 1.2 but
> now this won't work. From a standard Struts distribution, there needs to
> be a way to access the File or path to a file, from the Struts upload
> wrappers.

I also have some changes in mind for the Struts multipart handling, post
1.1 Final. We should talk about this on the Struts list. ;-)

Martin Cooper

> -Rob
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message