001package apps.jmrit.decoderdefn;
002
003import jmri.jmrit.decoderdefn.DecoderIndexCreateAction;
004
005/**
006 * Update the decoder index and store as a command-line action.
007 * <P>
008 * Not intended to be referenced from within JMRI itself, as this
009 * reconfigures logging for standalone operation.
010 *
011 * @author Bob Jacobsen Copyright (C) 2001, 2011, 2014
012 * @author Randall Wood Copyright (C) 2013
013 * @see jmri.jmrit.XmlFile
014 */
015public class DecoderIndexBuilder {
016
017    // main entry point to run standalone
018    static public void main(String[] args) {
019    
020        // logging needed for code invoked from here
021        String configFile = "default_lcf.xml";
022        apps.util.Log4JUtil.initLogging(configFile);
023        Thread.setDefaultUncaughtExceptionHandler(new jmri.util.exceptionhandler.UncaughtExceptionHandler());
024
025        // log the location where the result is stored
026        System.out.println(jmri.util.FileUtil.getUserFilesPath() + "decoderIndex.xml"); // command line
027
028        // recreate the index
029        DecoderIndexCreateAction da = new DecoderIndexCreateAction(null);
030        da.setIncrement(true);
031        da.actionPerformed(null);
032    }
033}