File in docroot write protected

Hello,

I have a web program that uploads images into a directory in docroot. The program also displays the images on a web page and allows the user to delete the images.

I have noticed that even after the server displays the images, they are still write protected. I assume by the application server. So, my code to delete the files doesn't work. Does anyone know a resolution to this? I am open to ideas.

File F =new File(fileLoc);

if (f.delete() ==false)

System.out.println("Could not delete" + fileLoc);

Thanks

Mike

[695 byte] By [mbrown36a] at [2007-11-26 14:43:39]
# 1
Could someone take another look at this? It is really important that I find a solution.Thanks
mbrown36a at 2007-7-8 8:31:17 > top of Java-index,Application & Integration Servers,Application Servers...
# 2

I got an answer to this on the Glassfish forum. It appears to work. The app server can cache or not cache files in the docroot. Caching will set the write protection flag and thus make them impossible to delete.

To not cache, change the file-caching-enabled and globally-enabled to false in the build.xml

<http-file-cache file-caching-enabled="true" file-transmission-enabled="false" globally-enabled="true" hash-init-size="0" max-age-in-seconds="30" max-files-count="1024" medium-file-size-limit-in-bytes="537600" medium-file-space-in-bytes="10485760" small-file-size-limit-in-bytes="2048" small-file-space-in-bytes="1048576"/>

change to

set file-caching-enabled="false" and globally-enabled="false"

mbrown36a at 2007-7-8 8:31:17 > top of Java-index,Application & Integration Servers,Application Servers...