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:JGraphLoader.GraphSaver.java

public static void saveG(String filename, Graph g) {

    final AbstractLayout layout = new StaticLayout(g);

    GraphMLWriter<node, edge> graphWriter = new GraphMLWriter<node, edge>();
    try {/*from w w  w.ja v a  2  s.  c o m*/
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));

        graphWriter.addEdgeData("id", null, "0", new Transformer<edge, String>() {
            @Override
            public String transform(edge i) {
                return i.getValue();
            }
        });
        /*
         graphWriter.addVertexData("y", null, "0",
         new Transformer<node, String>() {
         public String transform(node v) {
         return Double.toString(layout.getY(v));
         }
         }
         );*/

        graphWriter.save(g, out);
    } catch (IOException ex) {
        Logger.getLogger(GraphSaver.class.getName()).log(Level.SEVERE, null, ex);
    }

}

From source file:be.ugent.maf.cellmissy.analysis.KDTreeTest.java

@BeforeClass
public static void creteKDTree() {
    try {/*from  w  w  w  .jav a 2s. co  m*/
        // create a new KD Tree with two dimensions and add the first 3 points to it
        tree = new KDTree(2);
        tree.insert(A, "A");
        tree.insert(B, "B");
        tree.insert(C, "C");
    } catch (KeySizeException | KeyDuplicateException ex) {
        Logger.getLogger(KDTreeTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.iselect.web.controller.GlobalExceptionHandler.java

@ExceptionHandler(CopyPropertiesException.class)
public String copyPropertyException(CopyPropertiesException ex) {
    Logger.getLogger(GlobalExceptionHandler.class.getName()).log(Level.SEVERE, null, ex);
    return "global.exception.copyproperties";
}

From source file:ListOfCitys.CityList.java

public static JSONObject getCityNameForCountry(String countryName, String zipName) {
    List<String> cities = new ArrayList<>();
    List<String> citiesList = new ArrayList<>();
    JSONObject obj = new JSONObject();
    try {/*from   ww w . j  a  v  a  2  s.com*/
        WebService.setUserName("nane");
        ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
        searchCriteria.setQ(countryName);
        ToponymSearchResult searchResult;
        searchResult = WebService.search(searchCriteria);
        for (int i = 0; i < searchResult.getToponyms().size(); ++i) {
            cities.add(searchResult.getToponyms().get(i).getName());
        }
        for (int j = 0; j < 3; ++j) {
            citiesList.add(cities.get(new Random().nextInt(cities.size())));
        }
        obj.put(zipName, citiesList.toArray());
        return obj;
    } catch (Exception ex) {
        Logger.getLogger(CityList.class.getName()).log(Level.SEVERE, null, ex);
    }
    return obj;
}

From source file:flexpos.restfulConnection.java

public static ArrayList<ArrayList<String>> getRESTful(String RESTfull_URL, ArrayList<String> columnasTabla) {
    try {/*from www  .j  a  v a 2  s .c o m*/
        URL url;
        URLConnection urlConnection;
        DataInputStream readString;
        url = new URL(RESTfull_URL);
        urlConnection = url.openConnection();
        urlConnection.setDoInput(true);
        urlConnection.setUseCaches(false);
        readString = new DataInputStream(urlConnection.getInputStream());
        String s;

        String getRequest = "";
        while ((s = readString.readLine()) != null) {
            getRequest += s;
        }
        readString.close();
        if (!"".equals(getRequest)) {
            return completeArray(getRequest, columnasTabla);
        }

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

From source file:com.notes.listen.FsWatchService.java

public static void start(String path) {
    if (fsw == null) {
        lock.lock();//from www. j a  v  a 2  s  . c o  m
        if (fsw == null) {
            try {
                fsw = new FsWatcher(EventInst.getInstance().getAsyncEventBus(), Paths.get(path));
                try {
                    fsw.start();

                } catch (IOException ex) {
                    Logger.getLogger(FsWatchService.class.getName()).log(Level.SEVERE, null, ex);
                }
            } finally {
                lock.unlock();
            }
        }
    }
}

From source file:controller.NewEntryDeleteControllerTest.java

@BeforeClass
public static void setUpClass() {
    File file = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook" + fSeparator + "Users"
            + fSeparator + "Panagiwtis Georgiadis" + fSeparator + "Entries" + fSeparator + "Entry1");
    file.mkdirs();//w  ww.j  av a 2 s .c o  m
    file = new File(System.getProperty("user.dir") + fSeparator + "MyDiaryBook" + fSeparator + "Users"
            + fSeparator + "Panagiwtis Georgiadis" + fSeparator + "Entries" + fSeparator + "Entry2");
    file.mkdirs();
    File imageFile = new File(System.getProperty("user.dir") + fSeparator + "src" + fSeparator + "test"
            + fSeparator + "java" + fSeparator + "resources" + fSeparator + "testImg.jpg");
    try {
        FileUtils.copyFileToDirectory(imageFile, file);
    } catch (IOException ex) {
        Logger.getLogger(NewEntryDeleteControllerTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:io.getlime.push.repository.serialization.JSONSerialization.java

/**
 * Parsing message from JSON to PushMessageBody object.
 *
 * @param message Message to parse//from  w ww  .  j  a v  a  2 s. c o m
 * @return PushMessageBody
 */
public static PushMessageBody deserializePushMessageBody(String message) throws PushServerException {
    PushMessageBody pushMessageBody;
    try {
        pushMessageBody = new ObjectMapper().readValue(message, PushMessageBody.class);
    } catch (IOException e) {
        Logger.getLogger(PushCampaignController.class.getName()).log(Level.SEVERE, e.getMessage(), e);
        throw new PushServerException("Failed parsing from JSON");
    }
    return pushMessageBody;
}

From source file:in.bookmylab.Utils.java

public static String hashPassword(String password) {
    String hashed = null;/*from www  .j  a v a 2s.c  o  m*/
    try {
        if (!StringUtils.isBlank(password)) {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            byte[] hash = digest.digest((salt + password).getBytes(StandardCharsets.ISO_8859_1));
            //hashed = Base64.getEncoder().encodeToString(hash);
            hashed = Base64.encodeBase64String(hash);
        }
    } catch (NoSuchAlgorithmException ex) {
        log.log(Level.SEVERE, "Could not hash string.", ex);
    }
    return hashed;
}

From source file:io.bibleget.BibleGetI18N.java

/**
 *
 * @param s// w  ww.j  a v a  2 s. co m
 * @return
 */
public static String __(String s) {
    lcl = BibleGetIO.getLocale();
    Locale myLocale;
    myLocale = new Locale(lcl);
    try {
        myResource = ResourceBundle.getBundle("io.bibleget.resources.messages", myLocale);
    } catch (MissingResourceException ex) {
        myResource = ResourceBundle.getBundle("io.bibleget.resources.messages");
    }

    if (myResource.containsKey(s)) {
        try {
            String val = myResource.getString(s);
            return new String(val.getBytes("ISO-8859-1"), "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            Logger.getLogger(BibleGetI18N.class.getName()).log(Level.SEVERE, null, ex);
        }
    } else {
        return s;
    }
    return null;
}