[BUGFIX] Trick to avoid a lot of IllegalStateException
This commit is contained in:
@@ -64,7 +64,7 @@ class DiagramResponse {
|
|||||||
}
|
}
|
||||||
response.setContentType(getContentType());
|
response.setContentType(getContentType());
|
||||||
SourceStringReader reader = new SourceStringReader(uml);
|
SourceStringReader reader = new SourceStringReader(uml);
|
||||||
reader.generateImage(response.getOutputStream(), new FileFormatOption(format));
|
reader.generateImage(response.getOutputStream(), new FileFormatOption(format, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendMap(String uml) throws IOException {
|
void sendMap(String uml) throws IOException {
|
||||||
@@ -73,7 +73,7 @@ class DiagramResponse {
|
|||||||
}
|
}
|
||||||
response.setContentType(getContentType());
|
response.setContentType(getContentType());
|
||||||
SourceStringReader reader = new SourceStringReader(uml);
|
SourceStringReader reader = new SourceStringReader(uml);
|
||||||
String map = reader.generateImage(new NullOutputStream(), new FileFormatOption(FileFormat.PNG));
|
String map = reader.generateImage(new NullOutputStream(), new FileFormatOption(FileFormat.PNG, false));
|
||||||
String[] mapLines = map.split("[\\r\\n]");
|
String[] mapLines = map.split("[\\r\\n]");
|
||||||
PrintWriter httpOut = response.getWriter();
|
PrintWriter httpOut = response.getWriter();
|
||||||
for (int i=2; (i+1)<mapLines.length; i++) {
|
for (int i=2; (i+1)<mapLines.length; i++) {
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ public class PlantUmlServlet extends HttpServlet {
|
|||||||
}
|
}
|
||||||
response.setContentType("image/png");
|
response.setContentType("image/png");
|
||||||
SourceStringReader reader = new SourceStringReader(uml);
|
SourceStringReader reader = new SourceStringReader(uml);
|
||||||
reader.generateImage(response.getOutputStream(), new FileFormatOption(FileFormat.PNG));
|
reader.generateImage(response.getOutputStream(), new FileFormatOption(FileFormat.PNG, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ public class ProxyServlet extends HttpServlet {
|
|||||||
SourceStringReader reader = new SourceStringReader(getSource(source));
|
SourceStringReader reader = new SourceStringReader(getSource(source));
|
||||||
int n = num == null ? 0 : Integer.parseInt(num);
|
int n = num == null ? 0 : Integer.parseInt(num);
|
||||||
|
|
||||||
reader.generateImage(response.getOutputStream(), n, new FileFormatOption(getOutputFormat()));
|
reader.generateImage(response.getOutputStream(), n, new FileFormatOption(getOutputFormat(), false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSource(String uri) throws IOException {
|
private String getSource(String uri) throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user