protected ConfigurationParser getConfiguration(String playId) throws IOException { File applicationDirectory = project.getBasedir(); File playDirectory = new File(project.getBuild().getDirectory(), "play/home"); ConfigurationParser configParser = new ConfigurationParser(playId, applicationDirectory, playDirectory); configParser.parse(); return configParser; }
public void startServer() throws IOException { ConfigurationParser confParser = new ConfigurationParser(); try { String configPath = System.getProperty("moquette.path", null); confParser.parse(new File(configPath, "config/moquette.conf")); } catch (ParseException pex) { Log.warn("An error occured in parsing configuration, fallback on default configuration", pex); } Properties configProps = confParser.getProperties(); messaging = SimpleMessaging.getInstance(); messaging.init(configProps); m_acceptor = new NettyAcceptor(); m_acceptor.initialize(messaging, configProps); }
/** The main method for ProGuard. */ public static void main(String[] args) { if (args.length == 0) { System.out.println(VERSION); System.out.println("Usage: java proguard.ProGuard [options ...]"); System.exit(1); } // Create the default options. Configuration configuration = new Configuration(); try { // Parse the options specified in the command line arguments. ConfigurationParser parser = new ConfigurationParser(args); try { parser.parse(configuration); } finally { parser.close(); } // Execute ProGuard with these options. new ProGuard(configuration).execute(); } catch (Exception ex) { if (configuration.verbose) { // Print a verbose stack trace. ex.printStackTrace(); } else { // Print just the stack trace message. System.err.println("Error: " + ex.getMessage()); } System.exit(1); } System.exit(0); }