MCPcopy Create free account
hub / github.com/Ramos-dev/OSSTunnel / loadPayload

Method loadPayload

client/src/main/java/SennaLoader.java:38–80  ·  view source on GitHub ↗
(String strUrl)

Source from the content-addressed store, hash-verified

36 }
37
38 private static String loadPayload(String strUrl)
39 throws Exception {
40 URL url = new URL(strUrl);
41 URLConnection conn = null;
42// if ("file".equals( url.getProtocol() ))
43// {
44// conn = (FileURLConnection) url.openConnection();
45// }
46// else if ( "http".equals( url.getProtocol() ) )
47// {
48// conn = (HttpURLConnection) url.openConnection();
49//
50// }
51// else if ("ftp".equals( url.getProtocol()))
52// {
53// conn = (FtpURLConnection) url.openConnection();
54//
55// }
56 if ("https".equals(url.getProtocol())) {
57 HttpsURLConnection httpsConn = (HttpsURLConnection) url.openConnection();
58 httpsConn.setHostnameVerifier(new HostnameVerifier() {
59
60 @Override
61 public boolean verify(String hostname, SSLSession session) {
62 return true;
63 }
64 });
65 conn = httpsConn;
66 }
67
68 DataInputStream input = new DataInputStream(conn.getInputStream());
69
70 StringBuffer sb = new StringBuffer("");
71 String count = null;
72 while ((count = input.readLine()) != null) {
73 sb.append(count);
74 sb.append("\n");
75 }
76 input.close();
77
78 return sb.toString();
79
80 }
81
82 private static void savePayload(String strUrl)
83 throws Exception {

Callers 1

SennaLoaderClass · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected