File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes How to cleanup the attachments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to cleanup the attachments" Watch "How to cleanup the attachments" New topic

How to cleanup the attachments

Anuj Aggarwal

Joined: Mar 20, 2008
Posts: 1
I have a web service which returns an attachment. Following is the code
public DataHandler getFile() throws java.rmi.RemoteException
<some code that create the file "C:\">
DataHandler attachment = new DataHandler(new FileDataSource("C:\"));
return attachment;

I want to delete the "C:\" after returning it from webservice. What are the different ways to do it. I would prefer to delete it within the call that is returning it. Is this possible ?
I agree. Here's the link:
subject: How to cleanup the attachments
It's not a secret anymore!