| 127 | } |
| 128 | |
| 129 | private static Response getResponse(HttpURLConnection conn, String encoding) { |
| 130 | Response response = new Response(0, (String)null, (String)null, (String)null); |
| 131 | |
| 132 | try { |
| 133 | conn.connect(); |
| 134 | response.setCode(conn.getResponseCode()); |
| 135 | response.setHead(conn.getHeaderFields().toString()); |
| 136 | response.setText(streamToString(conn.getInputStream(), encoding)); |
| 137 | } catch (IOException var3) { |
| 138 | response.setError(var3.toString()); |
| 139 | LOGGER.debug(var3.toString()); |
| 140 | } |
| 141 | |
| 142 | return response; |
| 143 | } |
| 144 | |
| 145 | private static HttpURLConnection getCoon(String url) throws IOException, NoSuchProviderException, NoSuchAlgorithmException, KeyManagementException { |
| 146 | SSLContext sslcontext = SSLContext.getInstance("SSL", "SunJSSE"); |