Code example for NetworkInterface

Methods: getDisplayName

0
	public static boolean useInterface(NetworkInterface theInterface) {
		boolean result = true;
		String platform = System.getProperty("os.name");
		// only use these on windows platforms 
		if (platform.startsWith("Windows")) {
			if ((theInterface.getDisplayName()
					.equals("Teredo Tunneling Pseudo-Interface"))
					|| (theInterface.getDisplayName()
							.equals("6to4 Tunneling Pseudo-Interface"))
					|| (theInterface.getDisplayName()
							.equals("Automatic Tunneling Pseudo-Interface"))
					|| (theInterface.getDisplayName()
							.equals("Loopback Pseudo-Interface"))
					|| (theInterface.getDisplayName().equals("MS TCP Loopback interface"))) {
				result = false;
			} 
		} 
 
        if (platform.startsWith("Linux")) {
            if ((theInterface.getDisplayName().equals("lo"))
                    || (theInterface.getDisplayName().equals("teredo"))) {
                result = false;
            } 
        } 
        return result;
	} 
Contextual code suggestions in your IDE  Get Codota for Java