UploadedFile

If I have the file content, input stream, content type, name, and size from an UploadedFile object, can I create a new UploadedFile object from those attributes?
[168 byte] By [perryman777a] at [2007-11-27 3:23:22]
# 1
yes u can create.ThanksSrikanth
srikanthga at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Be careful with this, if you actually want two independent UploadFile objects with identical content, you have to duplicate (clone) the InputStream before. You're only passing the InputStream reference, not the contents itself. When one of the both InputStreams gets read, the another will also become empty then. Strings and primitives are immutable so you don't need to care about them.

BalusCa at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
thanks for the reply...that's what I was hoping to hear. I'm kind of new to this, can you give me an example of how I can create a brand new object from these attributes as there are no "setter" methods for this class?
perryman777a at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
By the way, I'm looking to create a totally separate object from the original, not just another reference.
perryman777a at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
I am not used with the UploadFile API, I have never used the UploadFile, but since srikanthg said that it is possible, I just assumed that it is possible with UploadFile. Well, maybe srikanthg knows more than me. Let him provide the answer :)
BalusCa at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
u can do the deep copy of the object, I u want to create u can,try to create deep copy.let me know if u need further helpthanksSrikanth
srikanthga at 2007-7-12 8:26:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...