mirror of
https://github.com/octoleo/plantuml-server.git
synced 2025-01-03 13:07:23 +00:00
Fix format management
This commit is contained in:
parent
f348627e84
commit
e7ed068417
@ -56,8 +56,6 @@ import javax.net.ssl.SSLPeerUnverifiedException;
|
|||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class ProxyServlet extends HttpServlet {
|
public class ProxyServlet extends HttpServlet {
|
||||||
|
|
||||||
private String format;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
|
||||||
|
|
||||||
@ -73,10 +71,6 @@ public class ProxyServlet extends HttpServlet {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fmt != "") {
|
|
||||||
format = fmt;
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate the response
|
// generate the response
|
||||||
String diagmarkup = getSource(srcUrl);
|
String diagmarkup = getSource(srcUrl);
|
||||||
SourceStringReader reader = new SourceStringReader(diagmarkup);
|
SourceStringReader reader = new SourceStringReader(diagmarkup);
|
||||||
@ -89,7 +83,7 @@ public class ProxyServlet extends HttpServlet {
|
|||||||
//System.out.println("uml=" + uml);
|
//System.out.println("uml=" + uml);
|
||||||
|
|
||||||
// generate the response
|
// generate the response
|
||||||
DiagramResponse dr = new DiagramResponse(response, getOutputFormat());
|
DiagramResponse dr = new DiagramResponse(response, getOutputFormat(fmt));
|
||||||
try {
|
try {
|
||||||
dr.sendDiagram(uml);
|
dr.sendDiagram(uml);
|
||||||
} catch (IIOException iioe) {
|
} catch (IIOException iioe) {
|
||||||
@ -121,7 +115,7 @@ public class ProxyServlet extends HttpServlet {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
private FileFormat getOutputFormat() {
|
private FileFormat getOutputFormat(String format) {
|
||||||
if (format == null) {
|
if (format == null) {
|
||||||
return FileFormat.PNG;
|
return FileFormat.PNG;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user