Java Local Address Check isLocalAddress(final String address)

Here you can find the source of isLocalAddress(final String address)

Description

is Local Address

License

Apache License

Declaration

public static boolean isLocalAddress(final String address) throws UnknownHostException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.net.InetAddress;
import java.net.UnknownHostException;

public class Main {
    public static boolean isLocalAddress(final String address) throws UnknownHostException {
        final InetAddress inetAddress = InetAddress.getByName(address);
        return inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress()
                || inetAddress.isLoopbackAddress();
    }/*w w  w  .  j ava  2 s.c o m*/
}

Related

  1. isLocal(String brokerAddress)
  2. isLocalAddress(final String addr)
  3. isLocalAddress(String address)
  4. isLocalAddress(String address)
  5. isLocalAddress(String address)
  6. isLocalAddress(String host)