Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to delete a image file from a application running in Tomcat

 
naveen garimella
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I need to delete a Image file from a application residing in a web server.
the approach iam using is from the UI, upon selection of the Image and click the delete button, iam passing the relative path to Struts action class through a form bean. In the Action class Iam doing file deletion in the follloeing way:
boolean success = (new File("/relative path")).delete();
when i do this I get the following error

java.io.FileNotFoundException: C:\<complete file path>(Access is denied)

I came to know that we have give access permissions for the users to the application insite Tomcat container.

Can any one guide me,how to set the access permissions (read/write/delete)for the application inside the tomcat container?

Regards,
Naveen Garimella
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic