List of usage examples for java.util.logging Level SEVERE
Level SEVERE
To view the source code for java.util.logging Level SEVERE.
Click Source Link
From source file:org.consultjr.mvc.core.components.formatters.DateFormatter.java
@Override public String print(Date object, Locale locale) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); try {/*from w w w .java 2 s . c o m*/ return formatter.format(object).toString(); } catch (Exception ex) { Logger.getLogger(DateFormatter.class.getName()).log(Level.SEVERE, null, ex); return null; } }
From source file:de.kaojo.chat.TextMessageDecoder.java
@Override public Message decode(String s) throws DecodeException { ObjectMapper mapper = new ObjectMapper(); try {/*w ww .j a v a 2 s . c o m*/ return mapper.readValue(s, Message.class); } catch (IOException ex) { Logger.getLogger(TextMessageDecoder.class.getName()).log(Level.SEVERE, null, ex); throw new DecodeException(s, "Encoded message could not be parsed to Message.class"); } }
From source file:com.me.DAO.DAO.java
public DAO() { driver = "com.mysql.jdbc.Driver"; dburl = "jdbc:mysql://localhost/booksdb"; dbuser = "root"; dbpassword = "mansijain"; try {//from w ww . j ava 2 s . co m Class.forName(driver); } catch (ClassNotFoundException ex) { Logger.getLogger(DAO.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:es.caib.sgtsic.util.DataHandlers.java
public static DataHandler byteArrayToDataHandler(byte[] arrayByte) { InputStream is = new BufferedInputStream(new ByteArrayInputStream(arrayByte)); String mimetype = ""; try {//from w w w.jav a 2 s. c o m mimetype = URLConnection.guessContentTypeFromStream(is); } catch (IOException ex) { Logger.getLogger(DataHandlers.class.getName()).log(Level.SEVERE, null, ex); } DataSource dataSource = new ByteArrayDataSource(arrayByte, mimetype); return new DataHandler(dataSource); }
From source file:com.hybridbpm.ui.component.chart.util.DiagrammeUtil.java
public static <T> T stringToObject(String json, Class<T> clazz) { T result = null;//from w ww . jav a 2 s .co m try { ObjectMapper mapper = new ObjectMapper(); // mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); mapper.configure(SerializationFeature.INDENT_OUTPUT, true); result = (T) mapper.readValue(json, clazz); } catch (IOException ex) { LOG.log(Level.SEVERE, ex.getMessage(), ex); } return result; }
From source file:com.chingo247.structureapi.plan.PlanGenerator.java
public static void generate(File directory) { Iterator<File> fileIterator = FileUtils.iterateFiles(directory, new String[] { "schematic" }, true); while (fileIterator.hasNext()) { File schemaFile = fileIterator.next(); try {/* ww w .ja v a 2 s. co m*/ generatePlanFromSchematic(schemaFile, directory); } catch (IOException ex) { Logger.getLogger(PlanGenerator.class.getName()).log(Level.SEVERE, null, ex); } } }
From source file:File.TXT.ReadFile.java
/** * @param args the command line arguments *///from w w w .ja v a 2 s . c o m public String read(String path, String nama_file) { String hasil = ""; File f = new File(path + nama_file); if (f.canRead()) { try { hasil = FileUtils.readFileToString(f); return hasil; } catch (IOException ex) { hasil = ex.getMessage(); Logger.getLogger(ReadFile.class.getName()).log(Level.SEVERE, null, ex); } } return hasil; }
From source file:css.variable.converter.CSSVariableConverter.java
public static void start(File sourceDirectory, File releaseDirectory) { try {//from w w w. j a v a2 s. co m FileUtils.copyDirectory(sourceDirectory, releaseDirectory); loadCSSFiles(releaseDirectory);// Find those CSS files File mainFile = getMainCSSFile();// Ask which file is the main file(so we can get variables) ArrayList<CSSVar> rootCSSVars = getCSSVars(mainFile, ":root");// Collect variables from main file editForRelease(rootCSSVars);// Go through existing CSS Files and replace variable access with variable values } catch (IOException ex) { Logger.getLogger(CSSVariableConverter.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.juicioenlinea.application.secutiry.Security.java
public static String encriptar(String texto) { final String secretKey = "hunter"; //llave para encriptar datos String encryptedString = null; try {//from ww w. ja v a2 s .c om MessageDigest md = MessageDigest.getInstance("SHA"); byte[] digestOfPassword = md.digest(secretKey.getBytes("UTF-8")); byte[] keyBytes = Arrays.copyOf(digestOfPassword, 24); SecretKey key = new SecretKeySpec(keyBytes, "DESede"); Cipher cipher = Cipher.getInstance("DESede"); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] plainTextBytes = texto.getBytes("UTF-8"); byte[] buf = cipher.doFinal(plainTextBytes); byte[] base64Bytes = Base64.encodeBase64(buf); encryptedString = new String(base64Bytes); } catch (NoSuchAlgorithmException | UnsupportedEncodingException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException ex) { Logger.getLogger(Security.class.getName()).log(Level.SEVERE, null, ex); } return encryptedString; }
From source file:com.searchbox.utils.DecryptLicense.java
public static boolean checkLicense(String lkey, String productName) { try {/*from w w w . j av a 2 s .c o m*/ String licval = new String(decrypt(Base64.decodeBase64(lkey))); String[] lines = licval.split("\n"); boolean datecheck = checkDate(lines[1]); return datecheck & lines[2].contains(productName); } catch (Exception ex) { Logger.getLogger(DecryptLicense.class.getName()).log(Level.SEVERE, null, ex); } return false; }