wood burning stoves 2.0
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
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:\1.zip">
DataHandler attachment = new DataHandler(new FileDataSource("C:\1.zip"));
return attachment;

I want to delete the "C:\1.zip" 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: http://aspose.com/file-tools
subject: How to cleanup the attachments