All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qiniu.util.RequestUtils Maven / Gradle / Ivy

There is a newer version: 8.4.8
Show newest version
package com.qiniu.util;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.List;

import static okhttp3.Dns.SYSTEM;

public class RequestUtils {

    public static String checkHost(String domain) throws UnknownHostException {
        if (domain == null || "".equals(domain)) throw new UnknownHostException("the hostname is empty.");
        List inetAddresses = SYSTEM.lookup(domain);
        return inetAddresses.get(0).getHostAddress();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy