List of usage examples for java.util.logging Logger getLogger
@CallerSensitive public static Logger getLogger(String name)
From source file:ec.edu.ucuenca.dcc.sld.ConfigInfo.java
private ConfigInfo() { InputStream resourceAsStream = this.getClass().getResourceAsStream("/config.json"); String theString;//from w w w .ja v a2 s. c o m try { theString = IOUtils.toString(resourceAsStream, Charset.defaultCharset().toString()); config = JSON.parse(theString).getAsObject().get("Config").getAsObject(); } catch (IOException ex) { Logger.getLogger(ConfigInfo.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.credomatic.gprod.db2query2csv.Security.java
/** * Decodifica un arreglo de byes y lo convierte en una cadena de carateres. * @param value areglo de bytes a ser decodificado * @return cadena de carateres resultado de la decodificacion */// w w w .j a v a2 s . c om public static String dencodeFromBase64(final byte[] value) { try { return new String(Base64.decodeBase64(value), "ISO-8859-1"); } catch (UnsupportedEncodingException ex) { Logger.getLogger(Security.class.getName()).log(Level.SEVERE, null, ex); } return null; }
From source file:com.cisco.oss.foundation.logging.FoundationLogger.java
/** * The sniffing Loggers are some special Loggers, whose level will be set to TRACE forcedly. * @param logger/* w ww. jav a2s. co m*/ */ private static void updateSniffingLoggersLevel(Logger logger) { InputStream settingIS = FoundationLogger.class.getResourceAsStream("/sniffingLogger.xml"); if (settingIS == null) { logger.debug("file sniffingLogger.xml not found in classpath"); } else { try { SAXBuilder builder = new SAXBuilder(); Document document = builder.build(settingIS); settingIS.close(); Element rootElement = document.getRootElement(); List<Element> sniffingloggers = rootElement.getChildren("sniffingLogger"); for (Element sniffinglogger : sniffingloggers) { String loggerName = sniffinglogger.getAttributeValue("id"); Logger.getLogger(loggerName).setLevel(Level.TRACE); } } catch (Exception e) { logger.error("cannot load the sniffing logger configuration file. error is: " + e, e); throw new IllegalArgumentException("Problem parsing sniffingLogger.xml", e); } } }
From source file:com.imag.nespros.network.devices.PADevice.java
public PADevice(String name) { super(name);/* www. ja va 2 s .co m*/ this.setCpuSpeed(1); this.setTotalMemory(5); this.setDeviceType(DeviceType.PA); this.setDeviceName(name); try { byte[] imageInByte; imageInByte = IOUtils.toByteArray(getClass().getClassLoader().getResourceAsStream("image/pa.jpg")); icon = new MyLayeredIcon(new ImageIcon(imageInByte).getImage()); } catch (IOException ex) { Logger.getLogger(AMIDevice.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.bookselling.util.FileUtilities.java
public void write(UploadedFile multipartFiles[], String path) { if (multipartFiles != null && multipartFiles.length != 0) { for (UploadedFile multipartFile : multipartFiles) { String fileWithFullPath = path + "/" + multipartFile.getName(); File file = new File(fileWithFullPath); try { FileUtils.writeByteArrayToFile(file, multipartFile.getData()); } catch (IOException ex) { Logger.getLogger(FileUtilities.class.getName()).log(Level.SEVERE, null, ex); }// w w w . j a v a 2 s . c om } } }
From source file:com.croer.javaaccess.Structure.java
public Structure(Object object) { Properties properties = new Properties(); try {/*from w w w . j a v a 2 s. c om*/ String fileProps = System.getProperty("user.dir") + "\\target\\classes\\entityStruc.properties"; FileInputStream input = new FileInputStream(fileProps); properties.load(input); } catch (FileNotFoundException ex) { Logger.getLogger(Structure.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(Structure.class.getName()).log(Level.SEVERE, null, ex); } String type = object.getClass().getName(); String key = properties.getProperty(type + ".key"); String context = properties.getProperty(type + ".context"); if (key == null || context == null) { throw new IllegalArgumentException( "Properties missing for type: " + type + " key " + key + " context " + context); } keyList = Arrays.asList(StringUtils.split(key, "|")); contextList = Arrays.asList(StringUtils.split(context, "|")); }
From source file:br.com.cantina.utils.Backup.java
public String getHash() { byte b[] = null; try (ByteArrayOutputStream bout = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream(bout)) { out.writeObject(this); bout.flush();/*from w w w . j av a 2 s .c o m*/ b = bout.toByteArray(); } catch (IOException ex) { Logger.getLogger(Backup.class.getName()).log(Level.SEVERE, null, ex); } if (b != null) return DigestUtils.md5Hex(b); return null; }
From source file:iing.uabc.edu.mx.persistencia.util.BeanManager.java
public BeanManager(String fullClassName) { try {/* www .ja v a 2s . c o m*/ //Get class by name Class<T> clazz = (Class<T>) Class.forName(fullClassName); setBeanClass(clazz); } catch (ClassNotFoundException ex) { Logger.getLogger(BeanManager.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.krj.karbon.GetFriendsList.java
public static List<SteamAccount> retrieve(String steamId) { String urlString = ""; List<SteamAccount> friends = new ArrayList(); try {/*from w w w . java 2 s. c om*/ //http://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=06326BE3F53F72F8C6EF31C158FBACD7&steamid=76561197976892493&relationship=all String host = "http://api.steampowered.com/"; String path = "ISteamUser/GetFriendList/v0001/"; String key = "?key=06326BE3F53F72F8C6EF31C158FBACD7"; String id = "&steamid=" + steamId; String relationship = "&relationship=all"; urlString = host + path + key + id + relationship; URL url = new URL(urlString); ObjectMapper mapper = new ObjectMapper(); Map<String, Object> JSONMap = mapper.readValue(url, Map.class); Map response = (Map) JSONMap.get("friendslist"); if (response != null) { List<Map> friendMaps = (List<Map>) response.get("friends"); if (friendMaps != null) { for (Map map : friendMaps) { String steamid = (String) map.get("steamid"); SteamAccount friend = GetPlayerSummaries.retrieve(steamid); friend.getOwnedGames(); friends.add(friend); } } } } catch (IOException ex) { Logger.getLogger(GetOwnedGames.class.getName()).log(Level.SEVERE, null, ex); } return friends; }
From source file:mum.bigdata.car.recommender.repository.impl.CarRepositoryImpl.java
@Override public Car getCar(long cid) { String sql = String.format("select * from car where cid='%d'", cid); try {// www . j a va2 s . c o m return this.get(sql).get(0); } catch (SQLException ex) { Logger.getLogger(MakeRepositoryImpl.class.getName()).log(Level.SEVERE, null, ex); } return null; }