Hi,
I'm developping a webservice who receives a doc file (attachement), convert it
to PDF then return the PDF file to the client. The service is simple :
public DataHandler convert(DataHandler docFile) {
File docFile = new File(docFile);
PDFConverter converter = new PDFConverter();
File pdfFile = converter.convertPDF(docFile);
return new DataHandler(new FileDataSource(pdfFile));
}
The convertPDF creates physically on the server a PDF file. I want to delete
the
local PDF file AFTER it is sent to the client. The problem is that I can't
delete the PDF before the convert method of the service returns (as there is a
DataHandler pointing to that file), but when the method's returned, I can no
longer control the server. I'm thinking of using an Axis Handler, but I don't
know exactly what to do. Is there a method to know when the response is
successfully sent to the client and trigger another method on the server??
Thanks a lot.
Kind regards,
Tuan Anh NGUYEN