Improvement: add graphical ui

This commit is contained in:
Laurent Clouet
2015-01-15 23:20:17 +01:00
parent 2df4657202
commit df7c97b6a4
13 changed files with 481 additions and 0 deletions

View File

@@ -714,6 +714,41 @@ public class Server extends Thread implements HostnameVerifier, X509TrustManager
return ServerCode.UNKNOWN;
}
public byte[] getLastRender() {
try {
HttpURLConnection httpCon = this.HTTPRequest(this.getPage("last-render-frame"));
InputStream inStrm = httpCon.getInputStream();
if (httpCon.getResponseCode() != HttpURLConnection.HTTP_OK) {
this.log.debug("Server::getLastRender code not ok " + httpCon.getResponseCode());
return null;
}
int size = httpCon.getContentLength();
if (size == 0) {
this.log.debug("Server::getLastRender size is 0");
return null;
}
byte[] ret = new byte[size];
byte[] ch = new byte[512 * 1024];
int n = 0;
int i = 0;
while ((n = inStrm.read(ch)) != -1) {
System.arraycopy(ch, 0, ret, i, n);
i += n;
}
inStrm.close();
return ret;
}
catch (Exception e) {
System.err.println("Server::getLastRender exception " + e);
e.printStackTrace();
}
return null;
}
private String generateXMLForMD5cache() {
String xml_str = null;
try {