So I am currently working on an internal tool and this problem came up. I am trying to parse this xml file every 10 seconds until it finds a particular tag. However this xml file gets modified as users click and do a bunch of stuff. i have a loop that opens a new fileinputstream and parses the xml file. But I keep getting a Premature End of File error. Does anyone know how to handle this?
while(notfound)
{
fis = new FileInputStream(new File("c:/tmp/abc.xml"));
SaxParser.parse(fis, sampleHandler);
notFound = sampleHandler.checkIfFound();
}