Example usage for java.util.logging Level SEVERE

List of usage examples for java.util.logging Level SEVERE

Introduction

In this page you can find the example usage for java.util.logging Level SEVERE.

Prototype

Level SEVERE

To view the source code for java.util.logging Level SEVERE.

Click Source Link

Document

SEVERE is a message level indicating a serious failure.

Usage

From source file:util.JSPUtil.java

public static void naytaJSP(HttpServletRequest request, HttpServletResponse response, String jspsivu) {
    RequestDispatcher dispatcher = null;
    //dispatcher = request.getRequestDispatcher("WEB-INF/jsp/muokkaatankki.jsp");
    dispatcher = request.getRequestDispatcher(jspsivu);
    try {/*from   w w  w  .j  a v a 2s .  c om*/
        dispatcher.forward(request, response);
    } catch (ServletException ex) {
        Logger.getLogger(JSPUtil.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(JSPUtil.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.ontologycentral.ldspider.LDSpider_LogUtil.java

public static void setDefaultLogging() {
    Logger.getLogger("").setLevel(Level.WARNING);
    // Suppress silly cookie warnings.
    Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.SEVERE);
    Logger.getLogger("").getHandlers()[0].setLevel(Level.ALL);
}

From source file:sandeep.kb.android.remote.utils.Utils.java

public static void sleep(long millis) {
    try {/* w w  w . j a va2  s.  c om*/
        Thread.sleep(millis);
    } catch (InterruptedException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.kamike.misc.MiscDateUtils.java

public static Date getDate(String value) {

    if ("".endsWith(value) || value == null) {
        return new Date(System.currentTimeMillis());
    }//w w w .  j  a  v a  2  s  .  co  m
    try {
        return DateUtils.parseDate(value, DATE_PATTERN);

    } catch (ParseException ex) {
        Logger.getLogger(MiscDateUtils.class.getName()).log(Level.SEVERE, null, ex);
        return new Date(System.currentTimeMillis());
    }
}

From source file:api.behindTheName.NameReader.java

static HashMap<String, String> load() {
    HashMap<String, String> data = new HashMap<>();

    File file = new File("options.txt");

    try {/*from ww  w . j  av  a 2  s  . co m*/
        List<String> lines = FileUtils.readLines(file);
        for (String s : lines) {
            if (s.contains("#"))
                continue;
            String htk = s.split("\\s")[0];
            String cntry = s.substring(htk.length() + 1);
            data.put(cntry, htk);
        }
    } catch (IOException ex) {
        Logger.getLogger(NameReader.class.getName()).log(Level.SEVERE, null, ex);
    }

    return data;

}

From source file:dk.sdu.mmmi.hwr.group2.Utils.java

public static Match getMatch(int matchID) {
    JSONObject json;/* w ww  .ja v a  2s .c  om*/
    String readURL = null;
    try {
        readURL = readURL("http://178.62.164.18:8080/foosball/api/match/get/" + matchID);
        json = new JSONObject(readURL);
    } catch (IOException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }

    JSONArray matches = json.getJSONArray("matches");
    JSONObject matchJSON = matches.getJSONObject(0);

    Match match = new Match(matchJSON.getInt("id"), matchJSON.getInt("startTime") * 1000l);
    JSONArray goalsJSON = matchJSON.getJSONArray("goals");

    for (int i = 0; i < goalsJSON.length(); i++) {
        JSONObject goal = goalsJSON.getJSONObject(i);
        int player = goal.getInt("player");
        int time = goal.getInt("time");
        match.addGoal(player, time * 1000l);
    }
    return match;
}

From source file:ju.ehealthservice.utils.ImageHandler.java

public static byte[] getBinData(String fileName) {
    try {/*from w ww.  ja v a 2  s  .co m*/
        File f = new File(fileName);
        byte[] bin = FileUtils.readFileToByteArray(f);
        return bin;
    } catch (FileNotFoundException ex) {
        Logger.getLogger(GetGraphImages.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(GetGraphImages.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:com.vigglet.util.JsonUtil.java

public static <T> T read(String json, Class<T> clazz) {
    try {//from   w  w w  . j  a v  a  2s .c  o  m
        return mapper.readValue(json, clazz);
    } catch (Exception e) {
        logger.log(Level.SEVERE, e.getMessage(), e);
        return null;
    }
}

From source file:com.jjtree.utilities.JConverter.java

public static JSONObject convert(HttpServletRequest request) throws IOException {
    StringBuilder sb = new StringBuilder();
    BufferedReader reader = request.getReader();
    try {/* w  w  w . j a v  a2 s.c  o  m*/
        String line;
        while ((line = reader.readLine()) != null) {
            sb.append(line).append('\n');
        }
    } finally {
        reader.close();
    }

    JSONObject jsonObject = null;
    try {
        jsonObject = new JSONObject(sb.toString());
    } catch (JSONException ex) {
        Logger.getLogger(JConverter.class.getName()).log(Level.SEVERE, null, ex);
    }

    return jsonObject;
}

From source file:dao.NewEntryDaoTest.java

@AfterClass
public static void tearDownClass() {
    try {/*  w w w.  j  a va  2 s .  co  m*/
        File testFile = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook" + fSeparator);
        FileUtils.deleteDirectory(testFile);
    } catch (IOException ex) {
        Logger.getLogger(NewEntryDaoTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}