• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Deleting file

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic