The main entry point for testing.
@param pstrArgs the command line arguments array if any.
@
17040
public static void main(String[] pstrArgs) 
    {
        IniFile objINI = null;
        String  strFile = null;

        if (pstrArgs.length == 0) return;

        strFile = pstrArgs[0];
        // Following call will load the strFile if one exists.
        objINI = new IniFile(strFile);

//        objINI.addSection("QADatabase", "QA database connection details\nUsed for QA Testing");
//        objINI.setStringProperty("QADatabase", "SID", "ORCL", null);
//        objINI.setStringProperty("QADatabase", "UserId", "System", null);
//        objINI.setStringProperty("QADatabase", "Password", "Manager", null);
//        objINI.setStringProperty("QADatabase", "HostName", "DBServer", null);
//        objINI.setIntegerProperty("QADatabase", "Port", 1521, null);
//        objINI.setStringProperty("QADatabase", "OracleHome", "%ORACLE_HOME%", null);
//        
        // objINI.setSectionComments("Folders", "Directories where generated files are stored");
        objINI.setStringProperty("Folders", "folder1", "G:\\Temp", null);
        objINI.setStringProperty("Folders", "folder2", "G:\\Temp\\Backup", null);

        // Save changes back to strFile.
        objINI.save();
        objINI = null;
    }
191688
public static void main(String[] args) throws IOException, InterruptedException {
    // Add final keyword to pass checkStyle.
    final int serverPort = getPortOrDefaultFromArgs(args, 0, 50051);
    final String cloudProjectId = getStringOrDefaultFromArgs(args, 1, null);
    final int zPagePort = getPortOrDefaultFromArgs(args, 2, 3000);
    final int prometheusPort = getPortOrDefaultFromArgs(args, 3, 9090);

    // Registers all RPC views. For demonstration all views are registered. You may want to
    // start with registering basic views and register other views as needed for your application.
    RpcViews.registerAllViews();

    // Registers logging trace exporter.
    LoggingTraceExporter.register();

    // Starts a HTTP server and registers all Zpages to it.
    ZPageHandlers.startHttpServerAndRegisterAll(zPagePort);
    logger.info("ZPages server starts at localhost:" + zPagePort);

    // Registers Stackdriver exporters.
    if (cloudProjectId != null) {
      StackdriverTraceExporter.createAndRegister(
          StackdriverTraceConfiguration.builder().setProjectId(cloudProjectId).build());
      StackdriverStatsExporter.createAndRegister(
          StackdriverStatsConfiguration.builder()
              .setProjectId(cloudProjectId)
              .setExportInterval(Duration.create(60, 0))
              .build());
    }

    // Register Prometheus exporters and export metrics to a Prometheus HTTPServer.
    PrometheusStatsCollector.createAndRegister();
    HTTPServer prometheusServer = new HTTPServer(prometheusPort, true);

    // Start the RPC server. You shouldn't see any output from gRPC before this.
    logger.info("gRPC starting.");
    final HelloWorldServer server = new HelloWorldServer(serverPort);
    server.start();
    server.blockUntilShutdown();
  }
59830
public static void main(String... args) {
    // Step 1. Enable OpenCensus Metrics.
    try {
      setupOpenCensusAndPrometheusExporter();
    } catch (IOException e) {
      System.err.println("Failed to create and register OpenCensus Prometheus Stats exporter " + e);
      return;
    }

    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));

    while (true) {
      try {
        readEvaluateProcessLine(stdin);
      } catch (IOException e) {
        System.err.println("EOF bye " + e);
        return;
      } catch (Exception e) {
        recordTaggedStat(KEY_METHOD, "repl", M_ERRORS, new Long(1));
        return;
      }
    }
  }
336807
public static void main(String[] args) {
    try {
      System.exit( ToolRunner.run(null, new Balancer(), args) );
    } catch (Throwable e) {
      LOG.error(StringUtils.stringifyException(e));
      System.exit(-1);
    }

  }
979198
public static void main(final String[] args) {
    GUIUtil.logUncaughtExceptions(LOG);
    GUIUtil.setLookAndFeel();
    OutputStep.setDefaultHandlerVisualizer();

    javax.swing.SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        try {
          final MultiStepGUI gui = new MultiStepGUI();
          gui.run();
          if(args != null && args.length > 0) {
            gui.setParameters(new SerializedParameterization(args));
          }
          else {
            gui.setParameters(new SerializedParameterization());
          }
        }
        catch(Exception | Error e) {
          // Restore error handler, as the GUI is likely broken.
          LoggingConfiguration.replaceDefaultHandler(new CLISmartHandler());
          LOG.exception(e);
        }
      }
    });
  }
1056095
public static void main(String[] args) throws IOException {

        // Make sure we've got something to do
        if (args == null || args.length == 0) {
            printUsageMessage();
            return;
        }

        LibertyTracePreprocessInstrumentation processor = new LibertyTracePreprocessInstrumentation();
        processor.processArguments(args);
        processor.processPackageInfo();
        processor.executeInstrumentation();
    }
201363
public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {
          GraphicalValidator window = new GraphicalValidator();
          window.frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }
80811
public static void main(String[] args) {
    BasicConfigurator.configure(new ConsoleAppender(
            new PatternLayout("%-5p: %m%n")));

    CmdLineParser parser = new CmdLineParser();
    CmdLineParser.Option help = parser.addBooleanOption('h', "help");
    CmdLineParser.Option filename = parser.addStringOption('t', "torrent");
    CmdLineParser.Option create = parser.addBooleanOption('c', "create");
    CmdLineParser.Option pieceLength = parser.addIntegerOption('l', "length");
    CmdLineParser.Option announce = parser.addStringOption('a', "announce");

    try {
      parser.parse(args);
    } catch (CmdLineParser.OptionException oe) {
      System.err.println(oe.getMessage());
      usage(System.err);
      System.exit(1);
    }

    // Display help and exit if requested
    if (Boolean.TRUE.equals(parser.getOptionValue(help))) {
      usage(System.out);
      System.exit(0);
    }

    String filenameValue = (String) parser.getOptionValue(filename);
    if (filenameValue == null) {
      usage(System.err, "Torrent file must be provided!");
      System.exit(1);
    }

    Integer pieceLengthVal = (Integer) parser.getOptionValue(pieceLength);
    if (pieceLengthVal == null) {
      pieceLengthVal = TorrentCreator.DEFAULT_PIECE_LENGTH;
    } else {
      pieceLengthVal = pieceLengthVal * 1024;
    }
    logger.info("Using piece length of {} bytes.", pieceLengthVal);

    Boolean createFlag = (Boolean) parser.getOptionValue(create);

    //For repeated announce urls
    @SuppressWarnings("unchecked")
    Vector<String> announceURLs = (Vector<String>) parser.getOptionValues(announce);

    String[] otherArgs = parser.getRemainingArgs();

    if (Boolean.TRUE.equals(createFlag) &&
            (otherArgs.length != 1 || announceURLs.isEmpty())) {
      usage(System.err, "Announce URL and a file or directory must be " +
              "provided to create a torrent file!");
      System.exit(1);
    }

    OutputStream fos = null;
    try {
      if (Boolean.TRUE.equals(createFlag)) {
        fos = new FileOutputStream(filenameValue);

        //Process the announce URLs into URIs
        List<URI> announceURIs = new ArrayList<URI>();
        for (String url : announceURLs) {
          announceURIs.add(new URI(url));
        }

        //Create the announce-list as a list of lists of URIs
        //Assume all the URI's are first tier trackers
        List<List<URI>> announceList = new ArrayList<List<URI>>();
        announceList.add(announceURIs);

        File source = new File(otherArgs[0]);
        if (!source.exists() || !source.canRead()) {
          throw new IllegalArgumentException(
                  "Cannot access source file or directory " +
                          source.getName());
        }

        String creator = String.format("%s (ttorrent)",
                System.getProperty("user.name"));

        TorrentMetadata torrent;
        if (source.isDirectory()) {
          List<File> files = new ArrayList<File>(FileUtils.listFiles(source, TrueFileFilter.TRUE, TrueFileFilter.TRUE));
          Collections.sort(files);
          torrent = TorrentCreator.create(source, files, announceList.get(0).get(0), announceList, creator, pieceLengthVal);
        } else {
          torrent = TorrentCreator.create(source, null, announceList.get(0).get(0), announceList, creator, pieceLengthVal);
        }

        fos.write(new TorrentSerializer().serialize(torrent));
      } else {
        new TorrentParser().parseFromFile(new File(filenameValue));
      }
    } catch (Exception e) {
      logger.error("{}", e.getMessage(), e);
      System.exit(2);
    } finally {
      if (fos != System.out) {
        IOUtils.closeQuietly(fos);
      }
    }
  }
253452
public static void main(final String[] args) {
		EnvironmentInformation.logEnvironmentInfo(LOG, "Command Line Client", args);

		// 1. find the configuration directory
		final String configurationDirectory = getConfigurationDirectoryFromEnv();

		// 2. load the global configuration
		final Configuration configuration = GlobalConfiguration.loadConfiguration(configurationDirectory);

		// 3. load the custom command lines
		final List<CustomCommandLine<?>> customCommandLines = loadCustomCommandLines(
			configuration,
			configurationDirectory);

		try {
			final CliFrontend cli = new CliFrontend(
				configuration,
				customCommandLines);

			SecurityUtils.install(new SecurityConfiguration(cli.configuration));
			int retCode = SecurityUtils.getInstalledContext()
					.runSecured(() -> cli.parseParameters(args));
			System.exit(retCode);
		}
		catch (Throwable t) {
			final Throwable strippedThrowable = ExceptionUtils.stripException(t, UndeclaredThrowableException.class);
			LOG.error("Fatal error while running command line interface.", strippedThrowable);
			strippedThrowable.printStackTrace();
			System.exit(31);
		}
	}
287366
public static void main(String[] args) {
        ConsoleWrapper console = new ConsoleWrapper(System.console(), System.err);

        // Create the SpringBootUtility and register tasks
        SpringBootUtility util = new SpringBootUtility(console, System.out, System.err);
        IFileUtility fileUtil = new FileUtility();
        util.registerTask(new ThinAppTask(fileUtil, SCRIPT_NAME));

        // Kick everything off
        int rc = util.runProgram(args).getReturnCode();
        System.exit(rc);
    }
84182
public static void main( String[] args)
    {
    int exitCode = 0;
    try
      {
      ReducerCommand reducer = new ReducerCommand();
      reducer.run( new Options( args));
      }
    catch( Exception e)
      {
      exitCode = 1;
      e.printStackTrace( System.err);
      }
    finally
      {
      System.exit( exitCode);
      }
    }
1332357
public static void main(String[] args) {

      TextReporter reporter = new TextReporter(System.out, System.err);

      run(reporter);

      if(reporter.hasErrors()) {
         System.exit(1);
      }
   }
861635
public void run(String[] args) {
		System.out.println("SampleStarter.run(String[])");
		System.out.println("- args.length: " + args.length);
		for (String arg : args) System.out.println("  - " + arg);
		System.out.println(this);
	}
167022
protected static void main(String args[]) {
	int from = Integer.parseInt(args[0]);	
	int to = Integer.parseInt(args[1]);
	
	statistics(from,to);
}
1242137
public static void main(String[] args) throws IOException {
    Properties props = new Properties(System.getProperties());
    props.load(JobServerMain.class.getResourceAsStream("system.properties"));
    System.setProperties(props);
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        startServer();
      }
    });
  }
1096631
public static void main(String[] args)
   {
      try
      {
         if (args.length != 1)
         {
            System.out.println("Usage: MpxCreate <output file name>");
         }
         else
         {
            create(args[0]);
         }
      }

      catch (Exception ex)
      {
         ex.printStackTrace(System.out);
      }
   }
722896
public static void main(final String[] args) {
    if (args.length < 1) {
      System.err.printf("$ java ... %s systemProperty [systemProperty]*%n", GetSystemPropertyValue.class.getName());
      System.exit(1);
    }

    Arrays.stream(args).forEach(systemProperty ->  System.out.println(newSystemPropertyValue(systemProperty)));
  }