Example usage for java.lang IllegalArgumentException getLocalizedMessage

List of usage examples for java.lang IllegalArgumentException getLocalizedMessage

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:fr.cs.examples.propagation.VisibilityCircle.java

/** Program entry point.
 * @param args program arguments//from  ww w  .ja v a2 s  . co m
 */
public static void main(String[] args) {
    try {

        // configure Orekit
        Autoconfiguration.configureOrekit();

        // input/out
        File input = new File(VisibilityCircle.class.getResource("/visibility-circle.in").toURI().getPath());
        File output = new File(input.getParentFile(), "visibility-circle.csv");

        new VisibilityCircle().run(input, output, ",");

        System.out.println("visibility circle saved as file " + output);

    } catch (URISyntaxException use) {
        System.err.println(use.getLocalizedMessage());
        System.exit(1);
    } catch (IOException ioe) {
        System.err.println(ioe.getLocalizedMessage());
        System.exit(1);
    } catch (IllegalArgumentException iae) {
        System.err.println(iae.getLocalizedMessage());
        System.exit(1);
    } catch (OrekitException oe) {
        System.err.println(oe.getLocalizedMessage());
        System.exit(1);
    }
}

From source file:fr.cs.examples.propagation.TrackCorridor.java

/** Program entry point.
 * @param args program arguments/*from www . ja  va2  s  . c o m*/
 */
public static void main(String[] args) {
    try {

        // configure Orekit
        Autoconfiguration.configureOrekit();

        // input/out
        File input = new File(TrackCorridor.class.getResource("/track-corridor.in").toURI().getPath());
        File output = new File(input.getParentFile(), "track-corridor.csv");

        new TrackCorridor().run(input, output, ",");

        System.out.println("corridor saved as file " + output);

    } catch (URISyntaxException use) {
        System.err.println(use.getLocalizedMessage());
        System.exit(1);
    } catch (IOException ioe) {
        System.err.println(ioe.getLocalizedMessage());
        System.exit(1);
    } catch (IllegalArgumentException iae) {
        System.err.println(iae.getLocalizedMessage());
        System.exit(1);
    } catch (OrekitException oe) {
        System.err.println(oe.getLocalizedMessage());
        System.exit(1);
    }
}

From source file:com.cfets.door.yarn.jboss.JBossClient.java

/**
 * @param args//  w  ww .jav a  2 s .co m
 *            Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        JBossClient client = new JBossClient();
        LOG.info("Initializing JBossClient");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.log(Level.SEVERE, "Error running JBoss Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.log(Level.SEVERE, "Application failed to complete successfully");
    System.exit(2);
}

From source file:org.etosha.cumulusonyarn.CumulusRDFRunner.java

/**
 * @param args/*from   ww w.  jav a 2 s .c  o  m*/
 *            Command line arguments
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        CumulusRDFRunner client = new CumulusRDFRunner();
        LOG.info("Initializing JBossClient");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.log(Level.SEVERE, "Error running JBoss Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.log(Level.SEVERE, "Application failed to complete successfully");
    System.exit(2);
}

From source file:com.ning.hfind.Find.java

public static void main(String[] origArgs) throws ParseException, IOException {
    PrinterConfig printerConfig = new PrinterConfig();

    CommandLineParser parser = new PosixParser();
    CommandLine line = parser.parse(options, origArgs);
    String[] args = line.getArgs();

    if (args.length > 1) {
        // find(1) seems to complain about the first argument only, let's do the same
        System.out.println(String.format("hfind: %s: unknown option", args[1]));
        System.exit(COMMAND_LINE_ERROR);
    }/*from   w w w .  j  a  v a 2 s  .co m*/
    if (line.hasOption("help") || args.length == 0) {
        usage();
        return;
    }

    String path = args[0];
    // Optimization: check the depth on a top-level basis, not on a per-file basis
    // This avoids crawling files on Hadoop we don't care about
    int maxDepth = Integer.MAX_VALUE;
    if (line.hasOption("maxdepth")) {
        String maxDepthOptionValue = line.getOptionValue("maxdepth");
        maxDepth = Integer.valueOf(maxDepthOptionValue);
    }
    if (line.hasOption("delete")) {
        // -delete implies -d
        printerConfig.setDepthMode(true);
        printerConfig.setDeleteMode(true);
    }
    if (line.hasOption("d")) {
        printerConfig.setDepthMode(true);
    }
    if (line.hasOption("print0")) {
        printerConfig.setEndLineWithNull(true);
    }
    if (line.hasOption("verbose")) {
        printerConfig.setVerbose(true);
    }

    // Ignore certain primaries
    Iterator<Option> optionsIterator = ExpressionFactory.sanitizeCommandLine(line.getOptions());

    Expression expression = null;
    try {
        expression = ExpressionFactory
                .buildExpressionFromCommandLine(new PushbackIterator<Option>(optionsIterator));
        //System.out.println(String.format("find %s: %s", StringUtils.join(origArgs, " "), expression));
    } catch (IllegalArgumentException e) {
        System.err.println(e);
        System.exit(COMMAND_LINE_ERROR);
    }

    try {
        expression.run(path, maxDepth, printerConfig);
        System.exit(0);
    } catch (IOException e) {
        System.err.println(String.format("Error crawling HDFS: %s", e.getLocalizedMessage()));
        System.exit(HADOOP_ERROR);
    }
}

From source file:org.hdl.caffe.yarn.app.Client.java

/**
 * @param args Command line arguments/*  ww  w. ja va 2s .c om*/
 */
public static void main(String[] args) {
    LOG.info("start main in appmaster!");
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:fr.cs.examples.propagation.DSSTPropagation.java

/** Program entry point.
 * @param args program arguments/*from   ww w . j a va  2 s .c  o m*/
 */
public static void main(String[] args) {
    try {

        // configure Orekit data acces
        Utils.setDataRoot("tutorial-orekit-data");

        // input/output (in user's home directory)
        File input = new File(new File(System.getProperty("user.home")), "dsst-propagation.in");
        File output = new File(input.getParentFile(), "dsst-propagation.out");

        new DSSTPropagation().run(input, output);

    } catch (IOException ioe) {
        System.err.println(ioe.getLocalizedMessage());
        System.exit(1);
    } catch (IllegalArgumentException iae) {
        System.err.println(iae.getLocalizedMessage());
        System.exit(1);
    } catch (OrekitException oe) {
        System.err.println(oe.getLocalizedMessage());
        System.exit(1);
    } catch (ParseException pe) {
        System.err.println(pe.getLocalizedMessage());
        System.exit(1);
    }
}

From source file:com.alibaba.jstorm.yarn.JstormOnYarn.java

/**
 * @param args Command line arguments//w  w  w  .j  av  a 2s  . c  o  m
 */
public static void main(String[] args) {
    boolean result = false;
    try {
        JstormOnYarn client = new JstormOnYarn();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(JOYConstants.EXIT_SUCCESS);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(JOYConstants.EXIT_FAIL);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(JOYConstants.EXIT_FAIL);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(JOYConstants.EXIT_SUCCESS);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(JOYConstants.EXIT_FAIL);
}

From source file:com.github.hdl.tensorflow.yarn.app.Client.java

/**
 * @param args Command line arguments//from  w  w w  .j  ava 2s.  c o  m
 */
public static void main(String[] args) {
    LOG.info("start main in appmaster!");
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing tensorflow client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}

From source file:cn.edu.buaa.act.petuumOnYarn.Client.java

/**
 * @param args/*from ww w. java2s .c  o  m*/
 *            Command line arguments
 */
public static void main(String[] args) {
    startTime = System.currentTimeMillis();
    boolean result = false;
    try {
        Client client = new Client();
        LOG.info("Initializing Client");
        try {
            boolean doRun = client.init(args);
            if (!doRun) {
                System.exit(0);
            }
        } catch (IllegalArgumentException e) {
            System.err.println(e.getLocalizedMessage());
            client.printUsage();
            System.exit(-1);
        }
        result = client.run();
    } catch (Throwable t) {
        LOG.fatal("Error running Client", t);
        System.exit(1);
    }
    if (result) {
        LOG.info("Application completed successfully");
        System.exit(0);
    }
    LOG.error("Application failed to complete successfully");
    System.exit(2);
}