Java Network Interface Get getInterfaces(final String interfaceName)

Here you can find the source of getInterfaces(final String interfaceName)

Description

get Interfaces

License

Apache License

Declaration

static Enumeration<NetworkInterface> getInterfaces(final String interfaceName) throws SocketException 

Method Source Code

//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*/
}

Related

  1. getInterfaces()
  2. getInterfaces()
  3. getInterfaces()
  4. getInterfaces()
  5. getInterfaces()
  6. getKey()
  7. getLinkLocalScopeId()
  8. getLocalInterfaces()
  9. getLocalMac()