Caching problem with Java picture resizing code

I am using the code included in this article: http://tinyurl.com/ytshr2 to resize some images on the fly for one of my company’s websites.

I have a process that allows a user to upload pictures that are attached to an

email to our web page. The agents display the attached images to the user,

allow them to select one as the primary image, detach the pictures to the

appropriate directory, rename them with the primary picture being XXXXX-1.jpg

(with XXXXX being an ID number) and then I use the Java code to resize all of

the pictures in the directory.

This all works great the first time the user uploads the pictures for a

particular ID number to the website. However, if I clear out all of the

pictures and try a second time, it keeps the same primary image even if I

select a different one. I have narrowed it down and the point where the sytem

is reverting back to the old primary image is when the Java code runs to resize

the pictures. Up until that point, the newly selected picture is still called

XXXXX-1.jpg. After the Java code runs, XXXXX-1.jpg is the old primary

picture.

I’m thinking that this has to be some kind of caching issue. Has anyone out

there had any caching problems using Java with Domino? This is my first time

using Java and I’m using the resizing code straight from that article.