Hi,
I use a Transformer to generate an xml file in a local directory. Then I broadcast the file over the system and finally I clean up the local directory. My problem, is that the transformer keeps an handle on the generated file... So I'm not able to delete the file, until the JVM is stopped...
I'm looking for any work around.
//Here is a sample to test the problem
public void testTransform() throws Exception{
Document doc = BasicDom.parseXmlFile("c:/
test.xml",
false);
TransformerFactory tFactory = TransformerFactory.newInst
ance();
Transformer transformer = tFactory.newTransformer();
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult("C:/result.xm
l");
transformer.transform(sour
ce, result);
if ( new File("c:/result.xml").dele
te()) {
System.out.println("ca marche!");
}
}
Thanks,
Marie-Soleil
Start Free Trial