public static void main(final String... paramArgs) throws Exception {
        checkArgument(paramArgs.length == 2, "Usage: XMLShredder input.xml output.tnk");

        System.out.print("Shredding '" + paramArgs[0] + "' to '" + paramArgs[1] + "' ... ");
        final long time = System.currentTimeMillis();

        Injector injector =
            Guice.createInjector(new ModuleSetter().setDataFacClass(TreeNodeFactory.class).setMetaFacClass(
                NodeMetaPageFactory.class).createModule());
        IBackendFactory storage = injector.getInstance(IBackendFactory.class);
        IRevisioning revision = injector.getInstance(IRevisioning.class);

        final File target = new File(paramArgs[1]);
        final StorageConfiguration config = new StorageConfiguration(target);
        Storage.truncateStorage(config);
        Storage.createStorage(config);
        final IStorage db = Storage.openStorage(target);
        Properties props = StandardSettings.getProps(target.getAbsolutePath(), "shredded");
        db.createResource(new ResourceConfiguration(props, storage, revision, new TreeNodeFactory(),
            new NodeMetaPageFactory()));
        final ISession session = db.getSession(new SessionConfiguration("shredded", StandardSettings.KEY));
        final INodeWriteTrx wtx = new NodeWriteTrx(session, session.beginBucketWtx(), HashKind.Rolling);
        // generating root node
        final NodeDelegate nodeDel = new NodeDelegate(wtx.getPageWtx().incrementDataKey(), NULL_NODE, 0);
        DocumentRootNode node =
            new DocumentRootNode(nodeDel, new StructNodeDelegate(nodeDel, NULL_NODE, NULL_NODE, NULL_NODE, 0));
        wtx.getPageWtx().setData(node);
        wtx.moveTo(org.treetank.data.IConstants.ROOT_NODE);

        final XMLEventReader reader = createFileReader(new File(paramArgs[0]));
        final XMLShredder shredder = new XMLShredder(wtx, reader, EShredderInsert.ADDASFIRSTCHILD);
        shredder.call();

        wtx.close();
        session.close();

        System.out.println(" done [" + (System.currentTimeMillis() - time) + "ms].");
    }
public static void main ( final String ... paramArgs ) throws Exception { checkArgument ( paramArgs . length == 2 , "Usage: XMLShredder input.xml output.tnk" ) ; System . out . print ( "Shredding '" + paramArgs [ 0 ] + "' to '" + paramArgs [ 1 ] + "' ... " ) ; final long time = System . currentTimeMillis ( ) ; Injector injector = Guice . createInjector ( new ModuleSetter ( ) . setDataFacClass ( TreeNodeFactory . class ) . setMetaFacClass ( NodeMetaPageFactory . class ) . createModule ( ) ) ; IBackendFactory storage = injector . getInstance ( IBackendFactory . class ) ; IRevisioning revision = injector . getInstance ( IRevisioning . class ) ; final File target = new File ( paramArgs [ 1 ] ) ; final StorageConfiguration config = new StorageConfiguration ( target ) ; Storage . truncateStorage ( config ) ; Storage . createStorage ( config ) ; final IStorage db = Storage . openStorage ( target ) ; Properties props = StandardSettings . getProps ( target . getAbsolutePath ( ) , "shredded" ) ; db . createResource ( new ResourceConfiguration ( props , storage , revision , new TreeNodeFactory ( ) , new NodeMetaPageFactory ( ) ) ) ; final ISession session = db . getSession ( new SessionConfiguration ( "shredded" , StandardSettings . KEY ) ) ; final INodeWriteTrx wtx = new NodeWriteTrx ( session , session . beginBucketWtx ( ) , HashKind . Rolling ) ; final NodeDelegate nodeDel = new NodeDelegate ( wtx . getPageWtx ( ) . incrementDataKey ( ) , NULL_NODE , 0 ) ; DocumentRootNode node = new DocumentRootNode ( nodeDel , new StructNodeDelegate ( nodeDel , NULL_NODE , NULL_NODE , NULL_NODE , 0 ) ) ; wtx . getPageWtx ( ) . setData ( node ) ; wtx . moveTo ( org . treetank . data . IConstants . ROOT_NODE ) ; final XMLEventReader reader = createFileReader ( new File ( paramArgs [ 0 ] ) ) ; final XMLShredder shredder = new XMLShredder ( wtx , reader , EShredderInsert . ADDASFIRSTCHILD ) ; shredder . call ( ) ; wtx . close ( ) ; session . close ( ) ; System . out . println ( " done [" + ( System . currentTimeMillis ( ) - time ) + "ms]." ) ; }
Main method.

@param paramArgs
input and output files
@throws Exception
if any exception occurs