Java Network Interface Check checkMethod(NetworkInterface iface, Method toCheck)

Here you can find the source of checkMethod(NetworkInterface iface, Method toCheck)

Description

check Method

License

Apache License

Declaration

private static Boolean checkMethod(NetworkInterface iface, Method toCheck) 

Method Source Code

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

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.*;

public class Main {
    private static Boolean checkMethod(NetworkInterface iface, Method toCheck) {
        if (toCheck != null) {
            try {
                return (Boolean) toCheck.invoke(iface, (Object[]) null);
            } catch (IllegalAccessException e) {
                return false;
            } catch (InvocationTargetException e) {
                return false;
            }//  w ww.  ja v a 2s  .  com
        }
        // Cannot check, hence we assume that is true
        return true;
    }
}

Related

  1. addAllInterfaces(List target, List level)
  2. cloneInterfaces( List interfaces)
  3. describeInterface(NetworkInterface subIf, boolean subinterface)
  4. dumpLocalNetworkInfo()
  5. hasNetworkAccess()