Determines the current host platform.

@return Current host platform.
485758
public static OS determineOS() {
		if(currentOs == null) {
			String osString = System.getProperty("os.name").trim().toLowerCase();
			if(osString.startsWith("windows")) {
				currentOs = OS.WIN32;
			} else if(osString.startsWith("mac os x")) {
				currentOs = OS.MACOSX;
			} else if(osString.startsWith("mac os")) {
				currentOs = OS.MACOSCLASSIC;
			} else if(osString.startsWith("risc os")) {
				currentOs = OS.RISCOS;
			} else if( 
					  (osString.indexOf("linux")>-1)
				   || (osString.indexOf("debian")>-1)
				   || (osString.indexOf("redhat")>-1)
				   || (osString.indexOf("lindows")>-1) ) {
				currentOs = OS.LINUX;
			} else if( 
					  (osString.indexOf("freebsd")>-1)
				   || (osString.indexOf("openbsd")>-1)
				   || (osString.indexOf("netbsd")>-1)
				   || (osString.indexOf("irix")>-1)
				   || (osString.indexOf("solaris")>-1)
				   || (osString.indexOf("sunos")>-1)
				   || (osString.indexOf("hp/ux")>-1)
				   || (osString.indexOf("risc ix")>-1)
				   || (osString.indexOf("dg/ux")>-1) ) {
				currentOs = OS.BSD;
			} else if(osString.indexOf("beos")>-1) {
				currentOs = OS.BEOS;
			} else {
				currentOs = OS.UNKNOWN;
			}
		}
		return currentOs;
	}
12362
def determine_hosts_path(platform=None):
        
        if not platform:
            platform = sys.platform
        if platform.startswith('win'):
            result = r"c:\windows\system32\drivers\etc\hosts"
            return result
        else:
            return '/etc/hosts'
1066742
public TestPlatform platform() {
        CodeGeneratorLoggerFactory.getLogger().debug(
                String.format("Specified platform in data file [%s] : [%s] ", fileName, reader.getPlatform()));
        TestPlatform currentPlatform = reader.getPlatform();
        if (currentPlatform == null) {
            String dataFile = new File(fileName).getAbsolutePath();
            throw new IllegalArgumentException("Missing or incorrect platform in Data file:" + dataFile);
        }
        return currentPlatform;
    }
828654
def get_driver_platform(self):
        
        platform = ''
        if 'platform' in self.driver.desired_capabilities:
            platform = self.driver.desired_capabilities['platform']
        elif 'platformName' in self.driver.desired_capabilities:
            platform = self.driver.desired_capabilities['platformName']
        return platform
44876
public String getRemoteHost()
  {
    InetAddress remoteAddress = addressRemote();
    
    if (remoteAddress != null)
      return remoteAddress.getHostAddress();
    else
      return null;
  }
1191009
public function getPlatform()
    {
        if (null === $this->platform) {
            // try to load the platform from the table
            $table = $this->getTable();
            if ($table && $database = $table->getDatabase()) {
                $this->setPlatform($database->getPlatform());
            }
        }

        if (!$this->table->isIdentifierQuotingEnabled()) {
            $this->platform->setIdentifierQuoting(false);
        }

        return $this->platform;
    }
930942
public function getHost()
    {
        if ($this->HOST) {

            if (strpos($this->HOST, ':') !== false) {
                $hostParts = explode(':', $this->HOST);

                return $hostParts[0];
            }

            return $this->HOST;
        }

        return $this->SERVER_NAME;
    }
1309794
public function host()
    {
        if (Validation::ip($this->_config['host'])) {
            return gethostbyaddr($this->_config['host']);
        }

        return gethostbyaddr($this->address());
    }
598256
protected String getHostsPath() {
		String path;
		if (System.getProperty("os.name").startsWith("Windows")) {
			path = "c:/windows/System32/drivers/etc/hosts";
		}
		else {
			path = "/etc/hosts";
		}
		return path;
	}
176872
public InetAddress getInetAddress() throws UnknownHostException{
     if(ip!=null) return ip;

     return (ip=InetAddress.getByName(host));
   }
1268067
public synchronized final String getHost() {
        if (host == null) {
            InetSocketAddress adr = getEndpointAddress();
            
            if ( adr != null && !adr.isUnresolved()) {
                host = getEndpointAddress().getHostName();
            }
        }

        return host;
    }
548668
public static String getHostname() {
		final String hostname = System.getProperty(HOSTNAME_PROPERTY);
		// TODO : Ensure hostname format is valid.
		return (hostname == null ? DEFAULT_HOSTNAME : hostname);
	}
900102
@Override
  protected CharSequence getHost()
  {
    if (_host != null)
      return _host;

    if (_uriHost.length() > 0) {
      _host = _uriHost;
    }
    else if ((_host = getForwardedHostHeader()) != null) {
    }
    else {
      _host = getHostHeader();
    }

    return _host;
  }
184368
public function getHost()
    {
        if (isset($this->env['HOST'])) {
            if (strpos($this->env['HOST'], ':') !== false) {
                $hostParts = explode(':', $this->env['HOST']);

                return $hostParts[0];
            }

            return $this->env['HOST'];
        } else {
            return $this->env['SERVER_NAME'];
        }
    }
142128
private String getHostName() {
        String hostName = AccessController.doPrivileged(new PrivilegedAction<String>() {
            @Override
            public String run() {
                try {
                    return java.net.InetAddress.getLocalHost().getCanonicalHostName().toLowerCase();
                } catch (java.net.UnknownHostException e) {
                    return "localhost";
                }
            }
        });
        return hostName;
    }
1010869
def platform(self):
        
        uname_sys = self._exec_command("uname -s")
        sysinfo = self._exec_command("sysinfo")
        if uname_sys is not None:
            if uname_sys == b"FreeBSD":
                return "freebsd"
            elif uname_sys == b"Darwin":
                return "darwin"
            elif uname_sys == b"Linux":
                return "linux"
            elif uname_sys.startswith(b"CYGWIN"):
                return "cygwin"
        elif sysinfo is not None and sysinfo:
            return "win32"
        return "unknown"
334416
@Override
    public int getServerPort() {
        int port = this.request.getVirtualPort();
        if (-1 == port && null != this.request.getHeader("Host")) {
            // if Host is present, default to scheme
            if ("HTTP".equalsIgnoreCase(this.request.getScheme())) {
                port = 80;
            } else {
                port = 443;
            }
        }
        // if still not found, use the socket information
        if (-1 == port) {
            port = this.connection.getLocalPort();
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "getServerPort: " + port);
        }
        return port;
    }