@Override public void process(JCas jCas) throws AnalysisEngineProcessException { Header header = selectSingle(jCas, Header.class); File pdfFile = new File(header.getSource()); checkFileExists(pdfFile); LOG.debug("extracting {}", pdfFile.getName()); try { PDFTextStream pdf; if (pdfFile.getName().endsWith("zip")) { InputStream is = unzipUniqueFileAsStream(pdfFile); pdf = new PDFTextStream(is, removeExtension(pdfFile.getName())); } else { pdf = new PDFTextStream(pdfFile); } BlockHandler blueHandler = new BlockHandler(); pdf.pipe(blueHandler); pdf.close(); PdfCollectionReader.extractText(jCas, blueHandler.getDoc(), header.getDocId(), expandAbbrevs); if (extractTables) PdfCollectionReader .extractTables(tableExtractor, pdfFile, jCas); // if (extractReferences) // extractReferences(f, jcas); } catch (Throwable t) { LOG.error("error extracting " + header.getSource(), t); // throw new AnalysisEngineProcessException(e); } }
try { Header header = JCasUtil.selectSingle(jCas, Header.class); sourceFile = header.getSource(); } catch (Throwable t2) {// nope
try { Header header = JCasUtil.selectSingle(jCas, Header.class); sourceFile = header.getSource(); } catch (Throwable t2) {// nope