Hi,
I am unzipping xml files from a zip file using
java util and reading xml files using DOM parser through my application after reading I want to delete the files which I unzipped. But until unless I wont close my application I cant delete the files. Even I tried to delete from Windows Explorer but it is showing message like
It is being used by another person or program. ........
How can I delete those files with out closing the application.
My code is:
try {
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(true);
DocumentBuilder builder;
try {
builder = domFactory.newDocumentBuilder();
File fileDirectory = new File(fileDir);
String files[] = fileDirectory.list();
Document
doc;
doc = builder.parse(fileDir+fileName);
doc.getDocumentElement ().normalize ();
String rootNode = doc.getDocumentElement().getNodeName();
NodeList bookslist = doc.getElementsByTagName(rootNode);
String servername = (String) ((Element) bookslist.item(0)).getElementsByTagName("servername").item(0).getChildNodes().item(0).getNodeValue();
String theatername = (String) ((Element) bookslist.item(0)).getElementsByTagName("theatername").item(0).getChildNodes().item(0).getNodeValue();
} catch (Exception e) {
e.printStackTrace();
}
Please guide me.
Thanking you.
--raaja. g