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?
# 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.
# 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 :)