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:it.unibo.alchemist.utils.L.java

/**
 * @param s// w w  w.ja v a 2  s .  c  o m
 *            the String to log
 */
@Deprecated
public static void error(final String s) {
    log(Level.SEVERE, s);
}

From source file:co.edu.unal.arqdsoft.presentacion.JSON.java

/**
 *
 * @param is//from w  ww  .j  ava2s. co m
 * @return
 */
public static String getTemplate(InputStream is) {
    try {
        byte[] charr = new byte[is.available()];
        is.read(charr);
        String text = new String(charr, "UTF-8");
        text = text.replace("\n", "").replace("\r", "").replace("  ", "").replace("\"", "'");
        return text;
    } catch (IOException ex) {
        Logger.getLogger(JSON.class.getName()).log(Level.SEVERE, null, ex);
        return "";
    }
}

From source file:de.serverfrog.pw.crypt.SerpentUtil.java

public static CipherOutputStream getOutputStream(OutputStream os, Key key) {
    try {/*  w ww. j a  va  2 s  .c om*/
        Cipher instance = Cipher.getInstance("Serpent", "BC");
        instance.init(Cipher.ENCRYPT_MODE, key);
        return new CipherOutputStream(os, instance);
    } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchProviderException
            | NoSuchPaddingException ex) {
        Logger.getLogger(SerpentUtil.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:ACE.Doc.java

public Doc(String path) {
    try {//from   ww w  . j a v a  2 s  .  c  om
        this.text = FileUtils.readFileToString(new File(path));
    } catch (IOException ex) {
        Logger.getLogger(Doc.class.getName()).log(Level.SEVERE, null, ex);
    }
    entities = new HashMap<>();
    relations = new ArrayList<>();
}

From source file:com.github.cc007.buildoffmanagermaven.utils.PersistencyHelper.java

public static boolean saveBuildOff() {
    try {//from w w  w  . ja  v a2s.c  o  m
        File boFile = new File(BuildOffManager.getPlugin().getDataFolder(), "BuildOff.json");
        Gson gson = new GsonBuilder().registerTypeAdapter(Location.class, new LocationAdapter()).create();
        String boString = gson.toJson(BuildOffManager.getPlugin().getActiveBuildOff());
        FileUtils.writeStringToFile(boFile, boString, Charset.defaultCharset());
        return true;
    } catch (IOException ex) {
        Logger.getLogger(PersistencyHelper.class.getName()).log(Level.SEVERE, null, ex);
    }
    return false;
}

From source file:com.neu.edu.DAO.DAO.java

public Connection getConnection() {
    Connection conn = null;/*  ww  w.j a v a2 s. c om*/
    try {
        conn = DriverManager.getConnection(dburl, dbuser, dbpassword);

    } catch (SQLException ex) {
        Logger.getLogger(DAO.class.getName()).log(Level.SEVERE, null, ex);
    }
    return conn;
}

From source file:mb.MbKorisnik.java

public Korisnik nadjiPoMailu(String email) {
    try {/*from   w w  w  .  jav a2  s  .com*/
        return korisnikServiceBean.findUserByLoginName(email);
    } catch (Exception ex) {
        Logger.getLogger(MbKorisnik.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:BLL.statsService.java

public ArrayList<top> getTop5User() {
    try {//from   w  ww . j  ava 2s . com

        return sDAO.getTop5User();

    } catch (SQLException ex) {
        Logger.getLogger(statsService.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:gui.CompressDecompress.java

public static byte[] compressBuffer(List<List<BigInteger>> encBuffer) {

    try {//from w  w  w.jav  a 2s.co  m
        File loc = new File("temp.dat");
        if (loc.exists()) {
            Files.delete(loc.toPath());
        }
        byte[] byteArray = serialize(encBuffer);
        AdaptiveArithmeticCompress.encoder(byteArray, loc.getAbsolutePath());

        InputStream is = new FileInputStream(loc);
        byte[] bytes = IOUtils.toByteArray(is);
        is.close();

        return bytes;

    } catch (IOException ex) {
        Logger.getLogger(CompressDecompress.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;

}

From source file:org.shareok.data.documentProcessor.FileHandlerFactory.java

/**
 *
 * @param fileExtension//w  w w. ja  v  a  2  s . c  o m
 * @return
 */
public static FileHandler getFileHandlerByFileExtension(String fileExtension) {

    FileHandler fh = null;
    String beanName = "";

    try {
        String fileTypePath = DocumentProcessorUtil.getFilePathFromResources("filetypes.xml");
        Document fileTypeDoc = loadXMLFromString(fileTypePath);
        fileTypeDoc.getDocumentElement().normalize();
        Element docEle = fileTypeDoc.getDocumentElement();
        NodeList nl = docEle.getChildNodes();

        if (nl != null && nl.getLength() > 0) {
            for (int i = 0; i < nl.getLength(); i++) {
                if (nl.item(i).getNodeType() == Node.ELEMENT_NODE) {
                    Element el = (Element) nl.item(i);
                    String nodeVal = el.getTextContent();
                    if (nodeVal.equals(fileExtension)) {
                        beanName = el.getAttribute("bean");
                        break;
                    }
                }
            }
        }

        ApplicationContext context = new ClassPathXmlApplicationContext("documentProcessorContext.xml");
        fh = (FileHandler) context.getBean(beanName);

    } catch (Exception ex) {
        Logger.getLogger(DocumentProcessorUtil.class.getName()).log(Level.SEVERE, null, ex);
    }

    return fh;
}