In a web application, I will use both java API and Linux System Calls to create a new directory, copy an image inside it and finally create a XML file with outputWriter. Then I will create download links to these resources on a JSP page. So far everything goes fine but when users try to access the files they get :
Http Status 404 - The requested resource (/export/myfile) is not available.
Trying to solve this I realized that if I rename the file to for example 'a' then rename it back to the original title, the link starts working. My first guess was that it's some kind of permission problem, so I provided all available permissions 'chmod 777 file' but nothing changed.
Normally I did some research on the net which lead to finding out that after restarting tomcat, links start working. I guess Tomcat somehow holds(freezes) these newly created files and they will be released after restart.
Saying all this, is there anyway to find out what exactly is going on and how I can fix it.