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.symbian.driver.utils.TestDriverConfigurator.java

/**
 * config TestDriver : Converts the launch configuration and the preferences
 * to TestDriver configuration.//from w w w.j a  v a 2 s  . co  m
 * 
 * @param aConfig
 * @return void
 * @throws
 */
public static void configTestDriver(ILaunchConfiguration aConfig) throws ParseException {
    if (aConfig != null) {
        try {
            convertLaunchConfig2TDConfig(aConfig);
        } catch (CoreException lCoreException) {
            LOGGER.log(Level.SEVERE, "Failed to set TestDriver configuration " + lCoreException.getMessage(),
                    lCoreException);
        }
    }
    // convertPreference(aPreferences);
}

From source file:jsfml1.NewJFrame.java

/**
 * @param args the command line arguments
 *//*  ww w .j a v  a  2  s .c  o  m*/
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null,
                ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new NewJFrame().setVisible(true);
        }
    });
}

From source file:mp3downloader.ZingSearch.java

public static ArrayList<Song> searchSong(String term) {
    try {//www . j  a v  a 2  s. c  o m
        String content = getSearchResult(term, 0);

        return readSongsFromContent(content);
    } catch (Exception ex) {
        Logger.getLogger(ZingSearch.class.getName()).log(Level.SEVERE, null, ex);
    }
    return new ArrayList<Song>();
}

From source file:com.flexdesktop.connections.restfulConnection.java

public static ArrayList<ArrayList<String>> getRESTful(String RESTfull_URL, ArrayList<String> columnasTabla) {
    try {/*  ww  w  . ja  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(com.flexdesktop.connections.restfulConnection.class.getName()).log(Level.SEVERE, null,
                ex);
    }
    return null;
}

From source file:br.com.ceosites.cachedproperties.cache.test.util.TestUtils.java

public static PropertyCache createDatabasePropertyCache(CustomDatabaseConfiguration dataseConfiguration) {
    DatabaseBasedConfigurationReaderStrategy readerStrategy = new DatabaseBasedConfigurationReaderStrategy(
            dataseConfiguration);/*from ww  w  .j  a va  2 s .  c o  m*/
    PropertyCacheLoader cacheLoader = new PropertyCacheLoader(readerStrategy);
    PropertyCache cache = null;
    try {
        cache = PropertyCacheBuilder.newBuilder().withCacheSize(100L).withIdleTime(2L).withTimeToLive(2L)
                .loadOnStartup(false).withPropertyCacheLoader(cacheLoader).buildCache();
    } catch (Exception ex) {
        Logger.getLogger(CachedDatabasePropertiesTest.class.getName()).log(Level.SEVERE, null, ex);
    }
    return cache;
}

From source file:io.fabric8.kubernetes.pipeline.devops.elasticsearch.BaseSendEvent.java

/**
 * Java main to test creating events in elasticsearch.  Set the following ENV VARS to point to a local ES running in OpenShift
 *
 * PIPELINE_ELASTICSEARCH_HOST=elasticsearch.vagrant.f8
 * ELASTICSEARCH_SERVICE_PORT=80/*from  w  w w  .  ja v  a2s . c  o m*/
 *
 * @param event to send to elasticsearch
 */
public static void send(DTOSupport event, String type) {

    hudson.model.BuildListener listener = new StreamBuildListener(System.out, Charset.defaultCharset());
    try {
        ObjectMapper mapper = JsonUtils.createObjectMapper();
        String json = mapper.writeValueAsString(event);
        String id = ElasticsearchClient.createEvent(json, type, listener);
        listener.getLogger().println("Added events id: " + id);
    } catch (Exception e) {
        LOG.log(Level.SEVERE, "Error when sending build data: " + event, e);
    }
}

From source file:com.smallfe.clerk.util.DigestUtil.java

public static String encryptEGM(String plainText) {
    StringBuilder cypherText = new StringBuilder();
    try {//from w w  w.ja v a  2s.c  o  m
        plainText = StringUtils.rightPad(plainText, ((plainText.length() - 1) / 3 + 1) * 3, (char) 0);
    } catch (NullPointerException ex) {
        Logger.getLogger(DigestUtil.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }
    for (int i = 0; i < plainText.length(); i += 3) {
        byte[] partitions = plainText.substring(i, i + 3).getBytes(Charset.forName("iso-8859-9"));
        int c1 = (int) (partitions[0]);
        if (c1 < 0)
            c1 += 256;
        int c2 = (int) (partitions[1]);
        if (c2 < 0)
            c2 += 256;
        int c3 = (int) (partitions[2]);
        if (c3 < 0)
            c3 += 256;

        int k1 = (c1) / 4;
        int k2 = (c1) % 4;
        int k3 = (c2) / 16;
        int k4 = (c2) % 16;
        int k5 = (c3) / 64;
        int k6 = (c3) % 64;

        char ec1 = decryptionAlphabet.charAt(k1);
        char ec2 = decryptionAlphabet.charAt(k3 + k2 * 16);
        char ec3 = decryptionAlphabet.charAt(k5 + k4 * 4);
        char ec4 = decryptionAlphabet.charAt(k6);

        cypherText.append(ec1);
        cypherText.append(ec2);
        if (c2 != 0)
            cypherText.append(ec3);
        if (c3 != 0)
            cypherText.append(ec4);
    }
    return cypherText.toString();
}

From source file:cz.cas.lib.proarc.common.export.cejsh.CejshConfig.java

public static CejshConfig from(Configuration conf) {
    CejshConfig cc = new CejshConfig();
    cc.setCejshXslUrl(conf.getString(PROP_MODS_XSL_URL, null));
    //        cc.setJournalUrl(conf.getString(PROP_JOURNALS_URL, null));
    try {/*from   w w w. j  ava2 s .c o  m*/
        boolean debug = conf.getBoolean(PROP_DEBUG, Boolean.FALSE);
        cc.setLogLevel(debug ? Level.INFO : Level.FINE);
    } catch (ConversionException ex) {
        LOG.log(Level.SEVERE, PROP_DEBUG, ex);
    }
    return cc;
}

From source file:com.a544jh.kanamemory.io.JsonFileReader.java

/**
 * Creates a new PlayerProfile object from a JSON file
 *
 * @param profileName The name field of the profile to be loaded, used as
 * the key in the JSON mapping./*from  w  w w  . j  a  va 2  s.  c o  m*/
 * @param filename Name of the JSON-formatted file to read the data from.
 * @return A new PlayerProfile with the character scores loaded from the
 * file.
 */
public static PlayerProfile loadProfile(String profileName, String filename) {
    PlayerProfile profile = new PlayerProfile(profileName);
    File file = new File(filename);
    try {
        //Get the profile's kanaScores from the file by using the name as key
        JSONObject kanaScores = readFileToJsonObject(file).getJSONObject(profileName);
        //Fill the profile's EnumMap with values
        populateKanaScores(profile, kanaScores);

    } catch (FileNotFoundException | JSONException ex) {
        Logger.getLogger(JsonFileReader.class.getName()).log(Level.SEVERE, null, ex);
    }
    return profile;
}

From source file:br.edimarmanica.weir2.rule.Loader.java

/**
 *
 * @param rule/* w w  w. j av  a2s. c  om*/
 * @param formatted valores formatados como na avaliao?
 * @return Map<PageId, Value>
 *
 */
public static Map<String, String> loadPageValues(File rule, boolean formatted) {
    Map<String, String> pageValues = new HashMap<>();

    try (Reader in = new FileReader(rule.getAbsolutePath())) {
        try (CSVParser parser = new CSVParser(in, CSVFormat.EXCEL.withHeader())) {
            for (CSVRecord record : parser) { //para cada value
                String url = formatURL(record.get("URL"));
                String value = record.get("EXTRACTED VALUE");

                if (formatted) {
                    value = Formatter.formatValue(value);
                }

                if (!value.trim().isEmpty()) {
                    pageValues.put(url, value);
                }
            }
        }
    } catch (FileNotFoundException ex) {
        Logger.getLogger(Loader.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(Loader.class.getName()).log(Level.SEVERE, null, ex);
    }
    return pageValues;
}