summaryrefslogtreecommitdiff
path: root/same/src/main/java/com/orbekk/net/HttpUtil.java
blob: 946c377f099500ea832c5ec5da18d6ab3cddd0af (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
package com.orbekk.net;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
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);
        }
    }
}