code: public static List<InetAddress> getLocalIpAddresses(boolean pruneSiteLocal, boolean pruneDown) throws RuntimeException
  	{
  		try
  		{
  			Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
  			List<InetAddress> addresses = new Vector<InetAddress>();
  
  			while (nics.hasMoreElements())
  			{
  				NetworkInterface iface = nics.nextElement();
  				Enumeration<InetAddress> addrs = iface.getInetAddresses();
  
  				if (!pruneDown || iface.isUp())
  				{
  					while (addrs.hasMoreElements())
  					{
  						InetAddress addr = addrs.nextElement();
  
  						if (!addr.isLoopbackAddress() && !addr.isLinkLocalAddress())
  						{
  							if (!pruneSiteLocal || (pruneSiteLocal && !addr.isSiteLocalAddress()))
  							{
  								addresses.add(addr);
  							}
  						}
  					}
  				}
  			}
  
  			return addresses;
  		}
  		catch (SocketException e)
  		{
  			throw new RuntimeException(e.getMessage(), e);
  		}
  	}
docs: Returns a list of local InetAddresses for this machine
  
  @param pruneSiteLocal
  boolean Set to true if site local (10/8, for example) addresses should be pruned
  @param pruneDown
  boolean Set to true to prune out interfaces whose .isUp() return false
  
  @return List[InetAddress] The list of addresses
  
  @throws RuntimeException
  If there is an error retrieving the InetAddresses
  @since IpHelper.java 2007-11-22