Thanks Alexey,

That would give us uniqueness across class loaders, and we could create the
UID just once.

To avoid creating a UID object every time a file is uploaded, in the
defaultFileItem class we would initialize a static String variable (call it
thisJvmId) with the UID method.  We would concatenate thisJvmId with the
existing static counter variable to have a unique ID across class loaders.

Although we are using the FileUpload 1.0 binary release (2003) - as yet
unmodified - we'd be happy to share our modification to defaultFileItem.  It
may save others from the strange, sporadic errors we encountered.  I'll
continue to lurk on the list to see how to best go about that.

Thanks,
Mike
 

Mike S wrote:

> Are there any suggestions as to the best way to modify the getUniqueId 
> method to return a unique ID across class loaders? We are thinking 
> along the lines of injecting a random number to concatenate with the 
> static counter in the DefaultFileItem, (or grabbing the start 
> timestamp off the jvm) to create unique names.

return new java.rmi.server.UID().toString().replace(':','-');


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to