File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Deleting a page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Deleting a page" Watch "Deleting a page" New topic

Deleting a page

Jonathan Chiu

Joined: Aug 01, 2001
Posts: 9
How can I delete a html page / file within my filestore while using servlets?
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
A servlet is no different in this respect than any other Java class. You can use the delete() method in the class:
File myFile = new File("c:/whatever/somefile");
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets

Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
I agree. Here's the link:
subject: Deleting a page
It's not a secret anymore!