title: How to constantly parse an xml log file (SAXParser) which gets dynamically modified in a server? I get Premature end of File error when it's modified
body: <p>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?</p>
  
  <pre><code>  while(notfound)
    {    
         fis = new FileInputStream(new File("c:/tmp/abc.xml"));
         SaxParser.parse(fis, sampleHandler);
         notFound = sampleHandler.checkIfFound();
    }
  </code></pre>