Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Deleting file  RSS feed

 
Abhijeet Gholkar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys
I want to delete files using jsp. When i invoke checkDelete(filename) it throws java.lang.SecuirtyException
I have checked all access rights.
I have used both absolute and relative path to the file
I am using Tomcat on linux server
I am trying to delete using java.io.File.delete()
please reply this is urgent
Raja
 
Peter Kristensson
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will you please post some code to let us see what you're trying to do.
Are you sure that the file-access permissions are correct for the user thats running tomcat?
Do you have write access to the directory to where the file exists?
 
Khurram Shahood(SCJP2)
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gholkar Raja:
hi guys
I want to delete files using jsp. When i invoke checkDelete(filename) it throws java.lang.SecuirtyException
I have checked all access rights.
I have used both absolute and relative path to the file
I am using Tomcat on linux server
I am trying to delete using java.io.File.delete()
please reply this is urgent
Raja

Mr.Raja First u should check do u have write access of that by using the method of isWrite() from java.io.file package then used the java.io.file delete() method to used that file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!