Parse the content of the specified file using this Digester. Returns the root element from the object stack (if any). @param file File containing the XML data to be parsed @return the root object @exception IOException if an input/output error occurs @exception SAXException if a parsing exceptio
(File file)
| 1595 | * @exception SAXException if a parsing exception occurs |
| 1596 | */ |
| 1597 | public Object parse(File file) throws IOException, SAXException { |
| 1598 | configure(); |
| 1599 | try (FileInputStream fis = new FileInputStream(file)) { |
| 1600 | InputSource input = new InputSource(fis); |
| 1601 | input.setSystemId("file://" + file.getAbsolutePath()); |
| 1602 | getXMLReader().parse(input); |
| 1603 | } |
| 1604 | return root; |
| 1605 | } |
| 1606 | |
| 1607 | |
| 1608 | /** |