public void file(String fileName, int length, InputStream data) throws IOException { try { SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); factory.setValidating(true); SAXParser parser = factory.newSAXParser(); parser.parse(data, attributesHandler); } catch (Exception e) { Safe.rethrow(IOException.class, e); } }
public void file(String fileName, int length, InputStream data) throws IOException { try { session.getWorkspace().importXML(path, data, ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING); } catch (RepositoryException e) { Safe.rethrow(IOException.class, e); } } public void endDirectory(String directoryName) throws IOException {
public void endDirectory(String directoryName) throws IOException { try { EndElement end = stack.removeLast(); handler.endElement(end.uri, end.localName, end.qName); if (stack.isEmpty()) { for (String prefix : prefixes) { log.log(Level.FINE, "Removing prefix mapping " + prefix); handler.endPrefixMapping(prefix); } prefixes.clear(); } } catch (Exception e) { Safe.rethrow(IOException.class, e); } }