You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Nguyen Tuan Anh <Tu...@insa-lyon.fr> on 2005/11/21 15:25:32 UTC

Axis Handler help !!

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