return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); return new NamedOutputStream(outputFile.getAbsolutePath(), new CloseShieldOutputStream(singularTargetStream)); return new NamedOutputStream(outputFile.getAbsolutePath(), CompressionUtils.getOutputStream(outputFile));
return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); return new NamedOutputStream(outputFile.getAbsolutePath(), new CloseShieldOutputStream(singularTargetStream)); return new NamedOutputStream(outputFile.getAbsolutePath(), CompressionUtils.getOutputStream(outputFile));
@Override public void process(JCas jcas) throws AnalysisEngineProcessException { NamedOutputStream aw = null; PrintStream ps = null; try { aw = getOutputStream(jcas, ".md"); ps = new PrintStream(aw); ps.print(getMarkdownString(jcas)); ps.flush(); aw.flush(); } catch (IOException e) { e.printStackTrace(); } finally { IOUtils.closeQuietly(ps); IOUtils.closeQuietly(aw); } }
protected NamedOutputStream getOutputStream(JCas aJCas, String aExtension) throws IOException { if (targetLocation == null) { return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); } else if (singularTarget) { return getOutputStream((String) null, aExtension); } else { return getOutputStream(getRelativePath(aJCas), aExtension); } }
protected NamedOutputStream getOutputStream(JCas aJCas, String aExtension) throws IOException { if (targetLocation == null) { return new NamedOutputStream(null, new CloseShieldOutputStream(System.out)); } else if (singularTarget) { return getOutputStream((String) null, aExtension); } else { return getOutputStream(getRelativePath(aJCas), aExtension); } }