Here you can find the source of getInterfaces(final String interfaceName)
static Enumeration<NetworkInterface> getInterfaces(final String interfaceName) throws SocketException
//package com.java2s; //License from project: Apache License import java.net.NetworkInterface; import java.net.SocketException; import java.util.Arrays; import java.util.Enumeration; import java.util.Vector; public class Main { static Enumeration<NetworkInterface> getInterfaces(final String interfaceName) throws SocketException { return interfaceName != null ? new Vector<NetworkInterface>(Arrays.asList(NetworkInterface.getByName(interfaceName))).elements() : NetworkInterface.getNetworkInterfaces(); }/*from www. jav a 2 s. co m*/ }