• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to cleanup the attachments

 
Anuj Aggarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic