This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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
Similar Threads
SOAP compatibility
jsp email
sending pdf or any attachment from a java webservice to java client using JAX-WS and SAAJ
A problem with Attachment using saaj
SOAP with attachments, 3 questions