In an application I'm developing in java, I am using the ImageIO API to scale images, then write them to a directory and then inform a web server that the images are ready to be used. The last call before sending a signal to the web server is the method ImageIO.write() but the web server cannot find the generated images at that moment. ( Few milliseconds latter the web server is able to see them. ).
What I suspect is that ImageIO.write() is running asynchronously. I've searched a lot but i couldn't find if ImageIO.write() is a synchronous or asynchronous operation. If ImageIO.write() is not blocking the flow of the program, is there a non-hacking way to make it wait till the image has been written to the destination directory ?