This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to cleanup the attachments" Watch "How to cleanup the attachments" New topic
Author

How to cleanup the attachments

Anuj Aggarwal
Greenhorn

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 ?
 
 
subject: How to cleanup the attachments
 
Similar Threads
jsp email
A problem with Attachment using saaj
SOAP compatibility
SOAP with attachments, 3 questions
sending pdf or any attachment from a java webservice to java client using JAX-WS and SAAJ