List of usage examples for java.util.logging Logger getLogger
@CallerSensitive public static Logger getLogger(String name)
From source file:com.mycompany.story.StoryEditor.java
/** * Creates new form StoryEditor//from w w w.j av a 2 s .c om */ public StoryEditor() { initComponents(); try { initData(); } catch (IOException ex) { Logger.getLogger(StoryEditor.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 {//www. ja v a 2s .com 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; }
From source file:com.crocodoc.ws.implementacao.WebServicesCrocoDoc.java
@Override public Boolean delete(String uuid) { try {/*from w w w .jav a 2 s .c o m*/ return CrocodocDocument.delete(uuid); } catch (CrocodocException ex) { Logger.getLogger(WebServicesCrocoDoc.class.getName()).log(Level.SEVERE, null, ex); } return null; }
From source file:com.mmone.gpdati.config.GpDatiDbRoomMap.java
public GpDatiDbRoomMap(Database database) { this.database = database; try {/*from w w w. j a v a 2s. c o m*/ loadAll(); } catch (SQLException ex) { Logger.getLogger(GpDatiDbRoomMap.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:m.c.m.proxyma.context.ProxymaContextPool.java
/** * Constructor for this class/* w w w .java 2 s.c o m*/ */ public ProxymaContextPool() { this.proxymaContexts = new ConcurrentHashMap(); log = Logger.getLogger(""); }
From source file:com.idega.hibernate.HibernateUtil.java
public static SessionFactory configure() { try {//from www. j a va 2 s. c o m Logger loggerRoot = Logger.getLogger(HibernateUtil.class.getName()); Logger loggerConnect = Logger.getLogger("Connect"); loggerRoot.fine("In HibernateUtil try-clause"); loggerRoot.warning("In HibernateUtil try-clause"); loggerConnect.fine("In HibernateUtil try-clause via loggerConnect DEBUG*****"); // Create the SessionFactory from hibernate.cfg.xml Properties properties = getProperties(); Configuration configuration = new Configuration(); configuration.setProperties(properties); return configuration.buildSessionFactory(); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } }
From source file:com.nebel_tv.content.utils.ConnectionUtils.java
/** * * @param url// w w w. ja v a 2 s.co m * @return * @throws Exception */ public static InputStream getResponseAsStream(String url) throws Exception { if (ids.empty()) { init(); } String developerId = ids.pop(); url = url + "&Developerid=" + developerId; try { String result = IOUtils.toString(new URL(url)); ids.push(developerId); return new ByteArrayInputStream(result.getBytes()); } catch (MalformedURLException ex) { Logger.getLogger(ConnectionUtils.class.getName()).log(Level.SEVERE, null, ex); } catch (IOException ex) { Logger.getLogger(ConnectionUtils.class.getName()).log(Level.WARNING, null, ex); } return null; }
From source file:com.me.SmartContracts.Utils.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 {/* ww w .j a va2s. c om*/ inputstream = new FileInputStream(fileEntry); } catch (FileNotFoundException ex) { Logger.getLogger(ElasticSearch.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(ElasticSearch.class.getName()).log(Level.SEVERE, null, ex); } catch (SAXException ex) { Logger.getLogger(ElasticSearch.class.getName()).log(Level.SEVERE, null, ex); } catch (TikaException ex) { Logger.getLogger(ElasticSearch.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"); return docText; }
From source file:com.nessacademy.connection.QueryInstance.java
public String getQuery(String query) { this.queryLoader = QueryLoader.instance(); try {/* w w w .j a v a 2s . c o 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:birdnest.client.deamon.Settings.java
public void saveSettings() { try {/* w w w . j ava 2 s .c om*/ this.store(FileUtils.openOutputStream(currentFile), "Birdnest Client Deamon Settings"); } catch (IOException ex) { Logger.getLogger(Settings.class.getName()).log(Level.SEVERE, null, ex); } }