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:com.ness.academy.connection.QueryInstance.java

public String getQuery(String query) {
    try {/* w ww.  ja  va2  s.co m*/
        Map<String, String> queries = queryLoader.load(SQL_FILE);
        return queries.get(query);
    } catch (IOException ex) {
        Logger.getLogger(QueryInstance.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:FTP.FTPUploadFileDemo.java

public static void UploadFile(String arquivo, String nomeArquivo) {
    InputStream inputStream = null;
    try {//  w  w  w.ja  v a  2 s  . com
        // APPROACH #1: uploads first file using an InputStream
        File firstLocalFile = new File(arquivo);
        String firstRemoteFile = nomeArquivo;
        inputStream = new FileInputStream(firstLocalFile);
        System.out.println("Start uploading first file");
        boolean done = ftpClient.storeFile(firstRemoteFile, inputStream);
        inputStream.close();
        if (done) {
            System.out.println("The first file is uploaded successfully.");
        }
    } catch (FileNotFoundException ex) {
        Logger.getLogger(FTPUploadFileDemo.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(FTPUploadFileDemo.class.getName()).log(Level.SEVERE, null, ex);
    } finally {
        try {
            inputStream.close();
        } catch (IOException ex) {
            Logger.getLogger(FTPUploadFileDemo.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}

From source file:com.imag.nespros.network.devices.AMIDevice.java

public AMIDevice(String name, double cpuSpeed, int totalMemory) {
    super(name, cpuSpeed, totalMemory, DeviceType.AMI);
    try {/*from  www . j  av a2s  .c o m*/
        byte[] imageInByte;
        imageInByte = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("image/meter.jpeg"));
        icon = new MyLayeredIcon(new ImageIcon(imageInByte).getImage());
    } catch (IOException ex) {
        Logger.getLogger(AMIDevice.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.app.inventario.logica.seguridad.IntentosLoginLogicaImpl.java

public void actualizarIntentosFallidos(String usuario) throws HibernateException {
    try {//from   w  ww.  j  av a 2 s . com
        intentosLoginDAO.actualizarIntentosFallidos(usuario);
    } catch (HibernateException he) {
        Logger.getLogger(IntentosLoginLogicaImpl.class.getName()).log(Level.SEVERE, null, he);
        throw he;
    }
}

From source file:com.cyphermessenger.utils.Utils.java

public static byte[] scrypt_1024_4_2(byte[] p, byte[] s) {
    try {/*w  ww  .  ja  v  a2  s  . c o m*/
        return SCrypt.scrypt(p, s, 1024, 4, 2, HASH_LEN);
    } catch (GeneralSecurityException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:com.app.inventario.servicio.seguridad.IntentosLoginServicioImpl.java

public void actualizarIntentosFallidos(String usuario) throws HibernateException {
    try {//from   ww  w.j  a va2  s . c  om
        intentosLoginLogica.actualizarIntentosFallidos(usuario);
    } catch (HibernateException he) {
        Logger.getLogger(IntentosLoginServicioImpl.class.getName()).log(Level.SEVERE, null, he);
        throw he;
    }
}

From source file:com.controller.CTraderGetAllBrokers.java

public static List<Broker> getBrokerList() {
    String brokersString = "";
    try {/*from   www . java2  s  . c o  m*/
        HttpResponse<JsonNode> resp = Unirest.get("http://139.59.17.119:8080/api/admin/brokers")
                .header("content-type", "application/json").asJson();
        //THIS IS THE JSONRESPONSE TURNED INTO JSONOBJECT  
        JSONObject myRespO = new JSONObject(resp.getBody());
        JSONArray arrJson = myRespO.getJSONArray("array");
        //GET ORDERS FROM ARRAY
        List<Broker> brokerList = new ArrayList<>();

        for (int i = 0; i < arrJson.length(); i++) {
            JSONObject currentBr = arrJson.getJSONObject(i);
            Broker currentBroker = JsonParsing.parseJsonToBrokerObject(currentBr.toString());
            String currName = currentBroker.getName();
            brokerList.add(currentBroker);
            brokersString += currName + ", ";
        }
        System.out.println("Added Brokers to dropdown-list: " + brokersString);
        return brokerList;
    } catch (UnirestException | JSONException ex) {
        Logger.getLogger(ControllerPMCreatedOrders.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
}

From source file:com.mycompany.story.StoryEditor.java

/**
 * Creates new form StoryEditor//from  ww  w .j  a va2  s  . c  om
 */
public StoryEditor() {
    initComponents();
    try {
        initData();
    } catch (IOException ex) {
        Logger.getLogger(StoryEditor.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:edu.pitt.sis.infsci2730.finalProject.web.LogoutController.java

@RequestMapping(value = "", method = RequestMethod.GET)
public void logout(HttpServletResponse res, HttpSession session) {
    session.invalidate();/*from ww w . j av a2 s  .  c o  m*/
    try {
        res.sendRedirect("/eBusiness/user");
    } catch (IOException ex) {
        Logger.getLogger(LogoutController.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.mycompany.myelasticsearch.DocumentReader.java

public static String readDocument(String filepath, String fileName) {
    Tika tika = new Tika();
    final File folder = new File(filepath);
    String fileEntry = filepath + fileName;
    String filetype = tika.detect(fileEntry);
    System.out.println("FileType " + filetype);
    BodyContentHandler handler = new BodyContentHandler(-1);

    Metadata metadata = new Metadata();

    FileInputStream inputstream = null;
    try {/*  w  w w  .j av a2s  .c  om*/
        inputstream = new FileInputStream(fileEntry);
    } catch (FileNotFoundException ex) {
        Logger.getLogger(DocumentReader.class.getName()).log(Level.SEVERE, null, ex);
    }
    ParseContext pcontext = new ParseContext();

    //parsing the document using PDF parser
    PDFParser pdfparser = new PDFParser();
    try {
        pdfparser.parse(inputstream, handler, metadata, pcontext);
    } catch (IOException ex) {
        Logger.getLogger(DocumentReader.class.getName()).log(Level.SEVERE, null, ex);
    } catch (SAXException ex) {
        Logger.getLogger(DocumentReader.class.getName()).log(Level.SEVERE, null, ex);
    } catch (TikaException ex) {
        Logger.getLogger(DocumentReader.class.getName()).log(Level.SEVERE, null, ex);
    }

    //getting the content of the document
    docText = handler.toString().replaceAll("(/[^\\da-zA-Z.]/)", "");
    outputArray = docText.split("Article|Section|Borrower|Agents");
    int count = 0;
    String outputArrayString = "";
    for (String o : outputArray) {
        count++;
        outputArrayString += "Count" + count + o;
        System.out.println();

    }
    System.out.println(outputArrayString);
    return docText;
}