()
| 918 | |
| 919 | |
| 920 | public byte[] getInstalledContribsInfo() { |
| 921 | List<Contribution> contribs = getInstalledContribs(); |
| 922 | StringList entries = new StringList(); |
| 923 | for (Contribution c : contribs) { |
| 924 | String entry = c.getTypeName() + "=" + |
| 925 | PApplet.urlEncode(String.format("name=%s\nurl=%s\nrevision=%d\nversion=%s", |
| 926 | c.getName(), c.getUrl(), |
| 927 | c.getVersion(), c.getBenignVersion())); |
| 928 | entries.append(entry); |
| 929 | } |
| 930 | String joined = |
| 931 | "id=" + UpdateCheck.getUpdateID() + "&" + entries.join("&"); |
| 932 | // StringBuilder sb = new StringBuilder(); |
| 933 | // try { |
| 934 | // // Truly ridiculous attempt to shove everything into a GET request. |
| 935 | // // More likely to be seen as part of a grand plot. |
| 936 | // ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| 937 | // GZIPOutputStream output = new GZIPOutputStream(baos); |
| 938 | // PApplet.saveStream(output, new ByteArrayInputStream(joined.getBytes())); |
| 939 | // output.close(); |
| 940 | // byte[] b = baos.toByteArray(); |
| 941 | // for (int i = 0; i < b.length; i++) { |
| 942 | // sb.append(PApplet.hex(b[i], 2)); |
| 943 | // } |
| 944 | // } catch (IOException e) { |
| 945 | // e.printStackTrace(); |
| 946 | // } |
| 947 | // return sb.toString(); |
| 948 | return joined.getBytes(); |
| 949 | } |
| 950 | |
| 951 | |
| 952 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no test coverage detected