This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to cleanup the attachments  RSS feed

 
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 ?
 
I am Arthur, King of the Britons. And this is a tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!