commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Polites" <jason.poli...@everymail.com.au>
Subject Re: [FileUpload] Cannot extend DefaultFileItem
Date Thu, 25 Nov 2004 05:30:38 GMT
OK cool.

I have an interim solution so I can wait until the final 1.1 release.  I am basically housing
the DefaultFileItem inside my own FileItem implementation, which then exposes all the FileItem
methods and proxies method calls to the internal DefaultFileItem instance.  Not very extensible
I know, but it will do for now.

Thanks :)

----- Original Message ----- 
From: Martin Cooper <mfncooper@gmail.com>
To: Jakarta Commons Users List <commons-user@jakarta.apache.org>; Jason Polites <jason.polites@everymail.com.au>;
Martin Cooper <mfncooper@gmail.com>
Sent: Thursday, November 25, 2004 4:28 PM
Subject: Re: [FileUpload] Cannot extend DefaultFileItem

On Thu, 25 Nov 2004 15:13:10 +1100, Jason Polites
<jasonpolites@tpg.com.au> wrote:
> I am wanting to implement my own FileItem class which is really an extension of the DefaultFileItem
but with the added feature of creating (and providing access to) a physical file on the server
with the same name as the one uploaded.  However, I can't extend the DefaultFileItem class
because its constructor does not have an access modifier and therefore is not visible to extending
classes outside the org.apache.commons.fileupload package.  I don't want to re-implement all
the code in the DefaultFileItem, but I can't seen any other way.
> 
> Is there a reason this class was created to prevent it from ever being extended?

That was an unfortunate oversight in the 1.0 release. ;-(

In recent nightly builds, you'll find that the DefaultFileItem class
is deprecated, but the same functionality is provided in the
DiskFileItem class, in the .disk package. I would recommend that you
extend DiskFileItem to do what you need.

Although this isn't released code yet, what is there now is stable.
There are some new classes I'm working on adding, and then I'll be
shooting for a 1.1 release, as soon as I can make it happen.

--
Martin Cooper


> Please advise.
> 
>



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


Mime
View raw message