exception while deleting files from sun app server by jsp

I should use java.io.File class to remove a temp file I uploaded to server .

But I get Exception msg

"java.security.AccessControlException: access denied (java.io.FilePermission d:\tt.jpg delete)

java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)

java.security.AccessController.checkPermission(AccessController.java:427)

java.lang.SecurityManager.checkPermission(SecurityManager.java:532)

java.lang.SecurityManager.checkDelete(SecurityManager.java:990)

java.io.File.delete(File.java:869)

org.apache.jsp.upload_jsp._jspService(upload_jsp.java:101)

org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)

javax.servlet.http.HttpServlet.service(HttpServlet.java:860)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)

javax.servlet.http.HttpServlet.service(HttpServlet.java:860)

sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

java.lang.reflect.Method.invoke(Method.java:585)

org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)

java.security.AccessController.doPrivileged(Native Method)

javax.security.auth.Subject.doAsPrivileged(Subject.java:517)

org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)

org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)

?br>any one could tell me why?

and what is the best practice to implement suck a task?

[1763 byte] By [xutoaa] at [2007-10-2 12:15:04]
# 1
Well it seems that you don't have permissions to delete the given file. Are you sure this is a java problem and not just an administrative problem? IE the file rights are not set properly?
gimbal2a at 2007-7-13 9:00:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I don't know if it's an administrative problem?I actually use this in jsp fileand in sun appserver8.1 on windows 2000 server in admin enviro
xutoaa at 2007-7-13 9:00:10 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...