@Test public void testShredInputStream() throws TTException, IOException { long lastRevision = treetank.getLastRevision(RESOURCENAME); final IStorage storage = Storage.openStorage(DBFILE.getParentFile()); final ISession session = storage.getSession(new SessionConfiguration(DBFILE.getName(), StandardSettings.KEY)); final INodeWriteTrx wtx = new NodeWriteTrx(session, session.beginBucketWtx(), HashKind.Rolling); final InputStream inputStream = new ByteArrayInputStream("<testNode/>".getBytes()); WorkerHelper.shredInputStream(wtx, inputStream, EShredderInsert.ADDASFIRSTCHILD); assertEquals("test shred input stream", treetank.getLastRevision(RESOURCENAME), ++lastRevision); wtx.close(); session.close(); storage.close(); inputStream.close(); }
public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value, final EShredderInsert child) { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLEventReader parser; try { parser = factory.createXMLEventReader(value); } catch (final XMLStreamException xmlse) { throw new WebApplicationException(xmlse); } try { final XMLShredder shredder = new XMLShredder(wtx, parser, child); shredder.call(); } catch (final Exception exce) { throw new WebApplicationException(exce); } }
WorkerHelper { public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value, final EShredderInsert child) { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLEventReader parser; try { parser = factory.createXMLEventReader(value); } catch (final XMLStreamException xmlse) { throw new WebApplicationException(xmlse); } try { final XMLShredder shredder = new XMLShredder(wtx, parser, child); shredder.call(); } catch (final Exception exce) { throw new WebApplicationException(exce); } } }
WorkerHelper { public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value, final EShredderInsert child) { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLEventReader parser; try { parser = factory.createXMLEventReader(value); } catch (final XMLStreamException xmlse) { throw new WebApplicationException(xmlse); } try { final XMLShredder shredder = new XMLShredder(wtx, parser, child); shredder.call(); } catch (final Exception exce) { throw new WebApplicationException(exce); } } private  WorkerHelper(); }
WorkerHelper { public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value, final EShredderInsert child) { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLEventReader parser; try { parser = factory.createXMLEventReader(value); } catch (final XMLStreamException xmlse) { throw new WebApplicationException(xmlse); } try { final XMLShredder shredder = new XMLShredder(wtx, parser, child); shredder.call(); } catch (final Exception exce) { throw new WebApplicationException(exce); } } private  WorkerHelper(); static void shredInputStream(final INodeWriteTrx wtx, final InputStream value,
        final EShredderInsert child); static XMLSerializer serializeXML(final ISession session, final OutputStream out,
        final boolean serializeXMLDec, final boolean serializeRest, final Long revision); static XMLSerializer serializeXML(final ISession session, final OutputStream out,
        final boolean serializeXMLDec, final boolean serializeRest, final Long nodekey, final Long revision); StringBuilder createStringBuilderObject(); static void closeWTX(final boolean abortTransaction, final INodeWriteTrx wtx, final ISession ses); static void closeRTX(final INodeReadTrx rtx, final ISession ses); EIdAccessType validateAccessType(final String accessType); static WorkerHelper getInstance(); }
WorkerHelper { public static void shredInputStream(final INodeWriteTrx wtx, final InputStream value, final EShredderInsert child) { final XMLInputFactory factory = XMLInputFactory.newInstance(); factory.setProperty(XMLInputFactory.SUPPORT_DTD, false); XMLEventReader parser; try { parser = factory.createXMLEventReader(value); } catch (final XMLStreamException xmlse) { throw new WebApplicationException(xmlse); } try { final XMLShredder shredder = new XMLShredder(wtx, parser, child); shredder.call(); } catch (final Exception exce) { throw new WebApplicationException(exce); } } private  WorkerHelper(); static void shredInputStream(final INodeWriteTrx wtx, final InputStream value,
        final EShredderInsert child); static XMLSerializer serializeXML(final ISession session, final OutputStream out,
        final boolean serializeXMLDec, final boolean serializeRest, final Long revision); static XMLSerializer serializeXML(final ISession session, final OutputStream out,
        final boolean serializeXMLDec, final boolean serializeRest, final Long nodekey, final Long revision); StringBuilder createStringBuilderObject(); static void closeWTX(final boolean abortTransaction, final INodeWriteTrx wtx, final ISession ses); static void closeRTX(final INodeReadTrx rtx, final ISession ses); EIdAccessType validateAccessType(final String accessType); static WorkerHelper getInstance();  }