Getter for the available serial ports.

@return the available serial ports system names.
344642
public static String[] getAvailablePortNames() {
        SerialPort[] ports = SerialPort.getCommPorts();
        String[] portNames = new String[ports.length];
        for( int i = 0; i < portNames.length; i++ ) {
            String systemPortName = ports[i].getSystemPortName();
            portNames[i] = systemPortName;
        }
        return portNames;
    }
688676
public List<InetAddress> getSystemDNSServers() {

        List<InetAddress> dnsServers = new ArrayList<InetAddress>();
        ResolverConfig resolverConfig = new ResolverConfig();

        try {
            for(String dnsHostIp : resolverConfig.servers()) {
                if(dnsHostIp.equals("")) continue;
                dnsServers.add(InetAddress.getByName(dnsHostIp));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return dnsServers;
    }
486146
public Map<String, PortMapping> ports() {
    final ImmutableMap.Builder<String, PortMapping> builder = ImmutableMap.builder();
    for (final Map.Entry<String, PortMapping> e : job.getPorts().entrySet()) {
      final PortMapping mapping = e.getValue();
      builder.put(e.getKey(), mapping.hasExternalPort()
                              ? mapping
                              : mapping.withExternalPort(checkNotNull(ports.get(e.getKey()))));
    }
    return builder.build();
  }
1342311
def get_ports(self):
        
        ports = []
        container_ports = self.inspect(refresh=True)["NetworkSettings"]["Ports"]
        if not container_ports:
            return ports
        for p in container_ports:
            # TODO: gracefullness, error handling
            ports.append(p.split("/")[0])
        return ports
65905
public java.util.List<String> getDnsIpAddresses() {
        if (dnsIpAddresses == null) {
            dnsIpAddresses = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return dnsIpAddresses;
    }
34542
public static String[] getNames(Status[] status) {
    if (status == null) {
      return null;
    }
    String[] statusNames = new String[status.length];
    for (int i = 0; i < statusNames.length; i++) {
      statusNames[i] = status[i].getName();
    }
    return statusNames;
  }
50564
public byte[] getPort() {
        byte[] port = new byte[2];
        int p = (getEndpointAddress() == null ? this.port
                : getEndpointAddress().getPort());
        port[1] = (byte) p;
        port[0] = (byte) (p >> 8);
        return port;
    }
94036
public Connector[] getConnectors() {
        if (connectors != null) {
            return Arrays.copyOf(connectors, connectors.length);
        } else {
            return new Connector[]{};
        }
    }
272916
public String[] getInterfaces() {
        int size = mInterfaces.size();
        String[] names = new String[size];

        for (int i=0; i<size; i++) {
            names[i] = mInterfaces.get(i)
                .getType().getRootName();
        }

        return names;
    }
824096
public java.util.List<PlatformDevice> getPlatformDevices() {
        if (platformDevices == null) {
            platformDevices = new com.amazonaws.internal.SdkInternalList<PlatformDevice>();
        }
        return platformDevices;
    }
623972
def _get_available_ports():
    
    if platform.system() == 'Darwin':
        return glob.glob('/dev/tty.usb*')

    elif platform.system() == 'Linux':
        return glob.glob('/dev/ttyACM*') + glob.glob('/dev/ttyUSB*') + glob.glob('/dev/ttyAMA*')

    elif sys.platform.lower() == 'cygwin':
        return glob.glob('/dev/com*')

    elif platform.system() == 'Windows':
        import _winreg
        import itertools

        ports = []
        path = 'HARDWARE\\DEVICEMAP\\SERIALCOMM'
        key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, path)

        for i in itertools.count():
            try:
                ports.append(str(_winreg.EnumValue(key, i)[1]))
            except WindowsError:
                return ports
    else:
        raise EnvironmentError('{} is an unsupported platform, cannot find serial ports !'.format(platform.system()))
    return []
587042
public java.util.List<String> getBaseEndpointDnsNames() {
        if (baseEndpointDnsNames == null) {
            baseEndpointDnsNames = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return baseEndpointDnsNames;
    }
223922
public com.google.api.SystemParameters getSystemParameters() {
    return systemParameters_ == null ? com.google.api.SystemParameters.getDefaultInstance() : systemParameters_;
  }
785906
def available_ports(self):
        
        from mbuild.port import Port
        return [port for port in self.labels.values()
                if isinstance(port, Port) and not port.used]
1348532
public static String[] getParallelPortList() {
        Enumeration portList;
        portList = CommPortIdentifier.getPortIdentifiers();

        int serialPortCount = 0;
        while (portList.hasMoreElements()) {
            CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement();
            if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
                serialPortCount++;
            }
        }

        String[] retVal = new String[serialPortCount];

        serialPortCount = 0;
        portList = CommPortIdentifier.getPortIdentifiers();
        while (portList.hasMoreElements()) {
            CommPortIdentifier portId = (CommPortIdentifier) portList.nextElement();
            if (portId.getPortType() == CommPortIdentifier.PORT_PARALLEL) {
                retVal[serialPortCount++] = portId.getName();
            }
        }

        return retVal;
    }
1345633
private Map<String, Object> getConnectionInfo() {
        String[] hostnames = (String[]) props.get(HOST_NAMES);
        int[] ports = (int[]) props.get(PORTS);

        String hostname = (hostnames == null || hostnames.length < 1) ? null : hostnames[0];
        String port = (ports == null || ports.length < 1) ? null : String.valueOf(ports[0]);

        return sslHelper.getConnectionInfo(hostname, port);
    }
38165
def get_ports
      begin
        @port.get_ports
      rescue => ex
        Util.log_exception(ex, caller_locations(1, 1)[0].label)
        raise ex
      end
    end