Example usage for java.util NoSuchElementException printStackTrace

List of usage examples for java.util NoSuchElementException printStackTrace

Introduction

In this page you can find the example usage for java.util NoSuchElementException printStackTrace.

Prototype

public void printStackTrace(PrintStream s) 

Source Link

Document

Prints this throwable and its backtrace to the specified print stream.

Usage

From source file:fsi_admin.JFsiTareas.java

public JFsiTareas() {
    actualizando = false;//from   w ww .  ja v a2s  . co m
    timer = new JTimer(this, 60000);
    auto_act = false;
    auto_resp = false;
    auto_slds = false;
    auto_hora = 0;
    auto_min = 0;
    respaldos = "NC";
    postgresql = "general";
    actualizar = "NC";
    tomcat = "NC";
    salida = "";
    log = "";
    idsalida = -1;

    // Ahora inicia el gestor de tareas
    try {
        FileReader file = new FileReader("/usr/local/forseti/bin/.forseti_auto");
        BufferedReader buff = new BufferedReader(file);
        boolean eof = false;
        while (!eof) {
            String line = buff.readLine();
            if (line == null) {
                eof = true;
            } else {
                try {
                    StringTokenizer st = new StringTokenizer(line, "=");
                    String key = st.nextToken();
                    String value = st.nextToken();
                    if (key.equals("HORA")) {
                        String[] temp = value.split(":");
                        auto_hora = Integer.parseInt(temp[0]);
                        auto_min = Integer.parseInt(temp[1]);
                    } else if (key.equals("ACT"))
                        auto_act = (value.equals("1") ? true : false);
                    else if (key.equals("RESP"))
                        auto_resp = (value.equals("1") ? true : false);
                    else if (key.equals("SLDS"))
                        auto_slds = (value.equals("1") ? true : false);
                    else if (key.equals("POSTGRESQL"))
                        postgresql = value;
                    else if (key.equals("RESPALDOS"))
                        respaldos = value;
                    else if (key.equals("ACTUALIZAR"))
                        actualizar = value;
                    else if (key.equals("TOMCAT"))
                        tomcat = value;
                } catch (NoSuchElementException e) {
                    continue;
                }

            }

        }

    } catch (Throwable e) {
        e.printStackTrace(System.out);
    }

    timer.startTimer();
    System.out.println("El sistema de tareas se ha iniciado a las " + auto_hora + ":" + auto_min + "\n"
            + "PGSQL: " + postgresql + " RUTA: " + respaldos + " ACT = " + auto_act + " RESP = " + auto_resp
            + " SLDS = " + auto_slds);

}