Thanks . . .
I have uploaded the file using a
Struts 2 action. The framework automatically places a reference to the uploaded in the action property whose name matches <s:file name="image" label="Picture"/>, so I have:
private File image = null;
in my action with the appropriate getter and setter, of course.
I have not called createNewFile() or saved the object to any filesystem (Whether the file was saved in a temporary directory by the servlet container I don't know). It would just be as if I simply created a File object using:
and immediately wanted to rename it on the next line. Now calling
and then calling
returns "oldfilename.png"
Mind you that new File("newfilename.png") does not exist as an actual file, it just is the name I want associated with my File object.
No other processes have a handle on the file being uploaded and I have the rights to rename the file (but that shouldn't matter anyway since the file is in memory).
If I am misled anywhere, please let me know.
Eric