summaryrefslogtreecommitdiff
path: root/same/src/main/java/com/orbekk/net/HttpUtil.java
blob: b4bb8870db120059ae075ad4665538ab3d049e1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.orbekk.net;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class HttpUtil {
    private static final Logger logger =
            LoggerFactory.getLogger(HttpUtil.class);

    public static void sendHttpRequest(String url) {
        try {
            URL pingUrl = new URL(url);
            pingUrl.openStream();
            // URLConnection connection = pingUrl.openConnection();
            // connection.connect();
        } catch (MalformedURLException e) {
            logger.warn("Unable to send ping to {}: {}.", url, e);
        } catch (IOException e) {
            logger.warn("Error when sending ping: {}", e);
        }
    }
}