This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman 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 Building Microservices this week in the Design 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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: How to cleanup the attachments
It's not a secret anymore!