use of net.sourceforge.plantuml.NullOutputStream in project plantuml-server by plantuml.
the class DiagramResponse method sendCheck.
void sendCheck(String uml) throws IOException {
response.setContentType(getContentType());
SourceStringReader reader = new SourceStringReader(uml);
DiagramDescription desc = reader.outputImage(new NullOutputStream(), new FileFormatOption(FileFormat.PNG, false));
PrintWriter httpOut = response.getWriter();
httpOut.print(desc.getDescription());
}
use of net.sourceforge.plantuml.NullOutputStream in project plantuml-server by plantuml.
the class DiagramResponse method sendMap.
void sendMap(String uml) throws IOException {
response.setContentType(getContentType());
SourceStringReader reader = new SourceStringReader(uml);
final BlockUml blockUml = reader.getBlocks().get(0);
if (StringUtils.isDiagramCacheable(uml)) {
addHeaderForCache(blockUml);
}
final Diagram diagram = blockUml.getDiagram();
ImageData map = diagram.exportDiagram(new NullOutputStream(), 0, new FileFormatOption(FileFormat.PNG, false));
if (map.containsCMapData()) {
PrintWriter httpOut = response.getWriter();
final String cmap = map.getCMapData("plantuml");
httpOut.print(cmap);
}
}
Aggregations