delete help to windows folder

Hi, I am writing a jsf crawler that places a .txt in a windows folder on a web server the application is running on. It writes it to the folder no problems but it wont delete the files. I get a

java.security.AccessControlException: access denied. How do I get it to do this?

My method seems to be working ok it is a permission thing. Is there a windows user I have to make?

void deleteFiles(String o) {

File dir = new File(o);

if (dir.isDirectory()) {

String[] children = dir.list();

for (int i=0; i<children.length; i++) {

//deleteDir(new File(dir, children));

boolean success=(new File(o+children).delete());

log("File "+o+children+" deleted");

if(!success){

error("File "+o+children+" not deleted");

log("File "+o+children+" not deleted");

}

Many Thanks, Phil.>

[902 byte] By [decodudea] at [2007-10-2 6:25:21]
# 1
Figured it out. I put the following lines in the server.policy located inC:\Sun\Creator\SunAppServer8\domains\creator\configgrant {permission java.io.FilePermission "C:\\Inetpub\\wwwroot\\alerts\\nthEastVicThunder\\*", "read,write,delete";};Phil.
decodudea at 2007-7-16 13:27:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...